## CS 1401 Assignment #2

Date Assigned: Monday, September 10 or Tuesday, September 11, 2007.

Due Date: Monday, September 17, or Tuesday, September 18, 2007, before the beginning of your lab section.

Objective: The main objective of this assignment is to practice using input, output, arithmetic operations, and operations with strings.

Programming assignment: To protect students against rain, the university decided to require every student to purchase a special UTEP umbrella. These umbrellas comes in different size; the cost of an umbrella is proportional to its area in square inches: 1 square inch costs 10 cents, i.e., \$0.10. Umbrellas are of the shape of a half-sphere, so the area can be computed as 2 pi times the umbrella's radius squared. Your program should estimate a cost of an umbrella for a student and generate a bill. Specifically, your program should:

• ask the student for his or her name;
• ask the student for the desired umbrella radius (in inches);
• print a bill with the student's name and the cost of the umbrella.

Comment: define Pi as a constant.

Example: Suppose that a student Carlos Acosta selects an umbrella of radius 10.0 inches. Then, we compute the area as 2 * 3.141592 * 10.0^2 = 628.3184. The cost of this umbrella is then 0.1 * 628.3184 = \$62.83.