CIS 150 C++ Programming Project: Input, output, calculations

Objectives

  1. Declare and use variables
  2. Perform calculations
  3. Display a variable

Program requirements

  1. Include documentation comments at the start of the file.
  2. Follow the course style guidelines including indentation, naming conventions, spaces instead of tabs, etc.
  3. Declare five floating point variables for five scores that will be entered. Initialize them all to 0.0.
  4. Declare a string variable to hold a name that will be entered. Initialize it to a zero length string.
  5. Declare a floating point variable that will hold the average score. Initialize it to 0.0.
  6. Prompt the user for five scores, get them and store them for later. They should be floating point values.
  7. Prompt the user for their name and store it for later. Names including spaces must be accepted properly. Check the getline function for details on getting complete names and using cin.ignore() to eliminate extra newlines cin leaves behind in the input buffer.
  8. Calculate the average score and display it in a personalized message to the user which includes their name (see the example runs for details).

Points

Example run

Enter score #1: 65
Enter score #2: 72
Enter score #3: 87.5
Enter score #4: 91.3
Enter score #5: 69
Enter name: Chauncey Gardener
The average score for Chauncy Gardener is 76.96