Homework #12 CS 107 - Introduction to Scientific ComputationHomework #12

Due: Tuesday 11/26

0. Preparatory Reading: You will benefit from reviewing the portions of Java we've covered in the CS 111 Java Summary.

1. Greetings:  Create a Java program `Greetings.java` that prompts the user with "Your name? " to input their name, and prints "Hello, <name>!", where "<name>" is replaced by their input name.

Example Transcript (input underlined):

```Your name? Dolly
Hello, Dolly!
```

2. Division:  Create a program Division.java that prompts the user to enter two integers (as shown below).  The two integers a and b are then used to compute both the floating point and integer division results as follows.

Example Transcript (input underlined):

```Please enter integer a: 9
Please enter integer b: 4
Floating point division: a/b = 2.250000
Integer division: a/b = 2 remainder 1```

3. Circle: Define a class Circle (in Circle.java) with

• a constructor that takes a double radius,
• a getRadius method that takes no parameters and returns the double radius
• a setRadius method that takes a double radius parameter, sets the circle radius to that new value and returns nothing,
• a getDiameter method that takes no parameters and returns a double diameter value computed from the radius,
• a getArea method that takes no parameters and returns a double area value computed from the radius, and
• a getCircumference method that takes no parameters and returns a double circumference value computed from the radius.

4. Circle Test:  Create a Java program CircleTest.java that prompts the user to input a double radius, constructs a Circle object from the previous exercise, and prints the double diameter, circumference, and area as shown below.

Note: You can calculate the square of `radius` by using either `radius * radius` or `Math.pow(radius, 2)`.

Example Transcript (input underlined):

```Radius? 10
diameter = 20.000000
circumference = 62.831853
area = 314.159265```