/****************************************************************
 CS177/457 C++ Programming, Fall 1998

 Lab 2. Modify an existing program

 Here, below is a "peas in a pod" program similar to Program 2.6 on
 page 55 of the textbook. Follow these steps to complete the
 assignment. These steps are essentially the same as the last lab
 assignment.

 1. Edit the source code from this message exactly as in your
    first assignment.
 2. Use the editor to change the purpose of the program to calculate how
    many hot dogs a child can get given a total number of hot dogs, and
    a number of children. These two numbers should be read from the
    keyboard and the results of the calculation printed on the screen.
    The program should print both the number of hots dogs per child, and
    the number of hots dogs left over. For example:
      72 hot dogs divided among 15 children gives 4 each with 12 left over.
    You can use both integer division (the / operator) and the 
    modulus, or remainder operator % to do this. See page 77 for examples.
 3. Compile and run the program several times with different numbers
    to test its results.
 4. Run the program once more with the example input (72 and 15) but
    with redirected output to a file, and insert the output into a
    copy of the source code file.
 5. Print the file with the source code and output and hand it to me (RTH).
 6. Mail the same file to our grader (login rkabir).

Points to note:

o Use different file names from those used in Lab 1, so that you can 
  perserve your work from last week.
o You may get compilation errors and/or warnings. Pay attention to these
  messages because you program may not run correctly, or at all, because
  of these errors.
o Don't forget to put your name (at least) in the file header comment.
o Change the file header comment to reflect the new use of the program.
o Change the user prompts (the text strings printed by the program
  before asking for input) to suit the new purpose.
o The caculation is obviously different for the new use.
o Make sure your output is easily read and understood.

*******************************************************************/

/////////////////////////////////////////////////////////////////////
// This program reads the number of pods and the number of peas in //
// a pod and prints the total number of peas.                      //
// Walter Savitch, modified Roger Hartley, January 1998            //
/////////////////////////////////////////////////////////////////////

#include <iostream>

int main() {

  // give the user general instructions
  cout << "Press return after entering a number." << endl;
  
  // ask the user for the number of pods
  cout << "Enter the number of pods:" << endl;
  int numberOfPods;
  cin >> numberOfPods;

  // ask the user for the number of peas in each pod
  cout << "Enter the number of peas in a pod:" << endl;
  int peasPerPod;
  cin >> peasPerPod;
  
  // calculate the total number of peas
  int totalPeas;
  totalPeas = numberOfPods * peasPerPod;
  
  // print the result
  cout << "If you have ";
  cout << numberOfPods;
  cout << " pea pods" << endl;
  cout << "and ";
  cout << peasPerPod;
  cout << " peas in each pod, then" << endl;
  cout << "you have ";
  cout << totalPeas;
  cout << " peas in all the pods." << endl;
  
  return 0;
}

