CSci 151                                                             Spring 2015


                      Lab Assignment 3: Selection 

Develop a C++ program to compute the area of a circle, a cylinder, a rectangle,
a sphere, or a triangle based on the specifications and constraints listed 
below. Use your leomailName(e.g. gHopper, but not lab3) as the source file name.
Attach this file to an email sent tom.brown at the domain tamuc.edu on or before
Friday 6 March. Include our course code(CS151), your leomailName, and the 
assignment number(#3) in the subject of this email.

Steps:
1. Input: 
   Display a menu as a prompt to the user to enter either the code value
   1 for a circle, 2 for cylinder, 3 for rectangle, 4 for a sphere, or 5 for 
   triangle. If the choice is to compute the area of a circle(1) or sphere(4),
   also prompt for the radius; if a cylinder, prompt for radius and height, a 
   rectangle then prompt for length and width, or for a triangle have prompts
   to input the base and height.

2. Process: 
   Test the shape code entered, then compute the corresponding area, and assign
   string values to variables for shape description, a formula, and factors. The
   area of a circle is computed by PI(3.14) times radius squared(r * r); for a
   cylinder area is (2 * PI * radius squared) + (height * 2 * PI * radius); for
   a sphere area is 4 * PI * radius squared, a rectangle is length times width;
   and area of a triangle is one-half(0.5) the base times the height. Should one 
   enter an undefined input code, no area is to be calculated, and an exception
   message should be displayed.
   
3. Output:
   Prior to the menu, print a decriptive heading for the program user. After the
   process step, output a line of details with a full description for the shape
   (e.g. "circle" instead of 'c'), the formula to compute area (i.e. PI * r * r),
   the values of factors used (base, height, length, PI, radius, and width as 
   appropriate), and the area computed. Include identifying labels beside or 
   above the detail data. Example output:
   
      Compute Shape Area:
      
      Shape codes: circle=1, cylinder=2, rectangle=3, sphere=4, triangle=5
      Shape? 1
      Radius? 3
      
      Shape description: circle  
      Formula: PI * r * r  
      Factor(s): radius(r) = 3, PI=3.14
      Area = 28.26      
     
Notes:
1. Class exercises provide background and examples for this assignment. Our 
   Webpage has links to program examples and other resources (C++ Tutorial) 
   that may be useful. It is recommended that you analyze and implement the
   exercises and examples. By adapting fragments of these examples to the 
   problem to be solved, it should be possible to obtain a correct solution.
2. To maximize points earned, submit a "deliverable product" when due.