CIS 67 Lab 1
 
 

  1. Type in the program on p. 82 or retrieve it from my web page:

  2.  

     
     

    joda.temple.edu/~koffman
     
     

  3. Create a project Coins that contains program Coins.cpp.

  4.  

     

  5. Compile and execute the program.

  6.  

     

  7. Modify the program so that it handles dimes and quarters as well as nickels and pennies.

  8.  

     

  9. Add an if statement before the closing curly brace at the end to display the message "super saver!!!" if the coin collection is worth more than $5. For example, the if statement

  10.  

     
     

    if (x 0.0)

    cout << "x is positive" << endl;
     
     

    displays the message "x is positive" if x is greater than zero. Your new if statement should look similar to this one.
     
     

  11. Insert the line: for (int count = 1; count <= 3; count++) {

Just before the line //Read in the count of nickels and pennies.
 
 

Insert another closing curly brace at the end of the program. Explain the effect of adding these lines. What would happen if the number 3 were replaced with 5?
 
 

7. Assignments for next time: Projects #6, p. 98 and programming exercise #3 p. 112.  For #6, if the product is 3/4, the percentage should be 75.0. Follow the software development method and place the documentation in a long comment before each program.
 
 

/* this is how you write

a long comment

that comes at the beginning of your program

*/