Lab 5

The purpose of this lab is to allow you to experiment with interactive input to a program.

To do this lab, you must have completed program 1, "Grandmother's Trunk". Don't start on it until you finish this program.

When you finish this lab you should be able to:

  1. Prompt a user for input
  2. Read in the users response
  3. Use the response in your program
  4. Begin to understand how the basic design of a program can make it hard to modify to add features.

Please modify program 1 to be an interactive program. Before each round the computer should prompt for the next item to be added to the trunk. The program should use the input in the messages it prints. Don't forget to echo the input back to the user after it is read as well.

A sample session might look like this: (User responses are in red)

   What do you want to pack into the trunk?flower
   You added a flower.

   In my Grandmother's trunk I packed 
      a flower


   What do you want to pack into the trunk?shirt
   You added a shirt.

   In my Grandmother's trunk I packed 
      a flower and a shirt.
 
 ...

When you have finished, please email the .C file to dbennett@edinboro.edu, with the title lab5.