CS 55  Java Programming

Week 2

Agenda

Examples

References

The Java Tutorial - Getting Started
Introduction to Java Programming: Week 1 -  Elliotte Rusty Harold
Introduction to Java Programming: Java Procedural Syntax -  Elliotte Rusty Harold
Lecture Notes - week 2 - lecture notes based on Peter van der Linden's book Just Java

Lab2

  1. Exercise 2.19 on page 78:  Write an application that inputs from the user the radius of a circle as an integer and prints the circle's diameter, circumference, and area. For you may use either the literal constant 3.14159 or the symbolic constant Math.PI. Use the GUI techniques shown in Fig. 2.9 (the Addition.java example with the JOptionPane methods). Use the following formulas:

    diameter = 2r
    circumference = 2∏r
    area = ∏r2

  2. Exercise 2.28 on page 80:  Write an application that reads two integers and determines whether the first is a multiple of the second and prints the result. [Hint: Use the modulus (aka remainder) operator.]
 < CS 55  > Home Email Last Modified September 10, 2004