Class Exercise: Selection Structure


Selection: if and if...else statements

    if (booleanExpression) {statement(s)}

    [else if (booleanExpression) {statement(s)} ] ...

    [else  {statement(s)}];
    
0. Prompt with a menu and input a value for stampCode:
   a. firstClass (enter the letter f);
   b. postCard (enter c);
   c. penny (enter p);
 
 
1. Code an if statement for one-way selection that tests whether a variable 
   named stampCode equals 'f', and when this condition is true assigns 49
   (cents) to stampCost.



2. Make a two-way selection in the form of an if...else structure that tests 
   stampCode for 'f', and when that expression is true assigns 49 (cents) to 
   stampCost, though when false assigns 0 to stampCost.





3. Code a multiple selection structure that enhances the answer for number #2 
   in the form of "if..else if..else" with an expression that compares 
   stampCode to 'f' and when true assigns 49 to stampCost and "first class" to
   stampType, and when false tests stampCode for 'c' (i.e. post card) and when
   true assigns 34 to stampCost and "post card" to stampType, though when the 
   test for 'c' is false, would default to a trailing else that assigns 0 to
   stampCost, and "unknown" to stampType.













4. Enhance the solution for question 3 to replace the default else with a third
   selection testing for 'p' (penny stamp), and when true assigns 1 (cent) to 
   stampCost and "penny" to stampType, then have a default else that assigns 0
   to stampCost, and "unknown" to stampType.   
   
   
   
   
   
5. Output values for stampCost and stampType. Include side labels.