Please put your work in directory cs201 on your Linux account before 11:59pm of the day above.
Name the project Hw2_1
Solution
Name the project Hw2_2
Solution
Put both classes in project Hw2_3
Solution
The area can be computed by subtracting the area of the inner circle from the area of the outer circle. The circumference is the sum of the corresponding values for the inner and outer circles. If the outer radius is smaller that the inner one, the area and circumference should be 0. You can use constant Math.PI in computations.
Define an instantiable class Circle that stores the radii as class variables and has methods to compute the area and circumference. You set the circle radii with the setRadii method.
Your project should consist of two classes: Circle and Hw2_4. The second class has to contain method main which asks the user to enter the radii and outputs the area and the circumference.
Put both classes in project Hw2_4
Solution