# CS1150 (Fall 2012, Section 4): Programming Assignment 3

## Output and Documentation

## Instructions

- Start a program called
`CircleMath`

. It will involve keyboard input,
so we might as well add the `import`

line right off the bat:
/* CircleMath.java
* Your name
* CS1150.1208-4, Programming Assignment #3
* This program computes various numbers for a circle of radius r.
*/
import java.util.Scanner;
public class CircleMath {
public static void main(String[] args) {
// Code will go here
}
}

- Write code to prompt the user for a radius. Let's assume this will always
be an integer, specifying this in the prompt.
- Use
`Math.PI`

(or declare your own variable) to use in our
calculations.
- Compute the perimeter (circumference), area, and volume of a sphere with
radius
`r`

, using the following formulae. Keep in mind that x^{2} is the same as
`x * x`

and x^{3} is the same as `x * x * x`

:
C = 2 pi r
A = pi r^{2}
V = 4/3 pi r^{3}

- Print out the results of these computations using
`printf`

and the
format string "A circle with radius %d has perimeter %.2f, area %.2f\n
and a sphere with the same radius would have volume %.2f.\n"

## Deliverables

Zip up only the file `CircleMath.java`

, name the resulting zip file
`cs1150.1208-4-yourlastname-yourfirstname-pa3.zip`

, and submit this file
as per the syllabus.