CIS 260 Computer Programming I

Program Requirements: Circle Calculations

 

Design and code a Java program that calculates and prints the (D)iameter, the (C)ircumference, or the (A)rea of a circle, given the radius. The program inputs two data items: the calculation needed, and the radius of the particular circle.   The program should continue to ask the user for values until the user enters 'Q' as the type of calculation.

The program should echo print the input data and prompt appropriately. Label the output and format to two decimal places.  

Example:

     Enter the calculation type (A, C, D, N, Q):

N

New Circle, Enter radius:

6.75

     Enter the calculation type (A, C, D, N, Q):

A

     The area of a circle with radius 6.75 is 143.14

     Enter the calculation type (A, C, D, N, Q):

D  

     The diameter of a circle with radius 6.75 is 13.50

Enter the calculation type (A, C, D, N, Q) and radius:  

Q

     Thank You

During the Design Phase:

Write a pseudocode algorithm of the steps to solve this problem, and construct a test set for the program following the guidelines discussed in class.

During Coding:

Create a class CircleCalc with methods for each of the operations. The user interface (including all I/O) will be contained in  main(). which must use a do...while and a switch statement for selecting various user operations.

Project Deliverables:

Preliminary Specification: 

Problem Description
Algorithm
Test Set Design

Final Program: (All components in Presentation Format )
Problem Description
Algorithm
Test Set Design
Source Code
Sample Output