CSCI 240 Spring 2020

Program 2
Formatted Output and Symbolic Constants
(75 points)


Due: Friday, January 31 by 11:59 PM

Overview

For this assignment, modify program 1 so that it will calculate the program and test averages rather than having the user enter the values.

Basic Program Logic

The basic logic for this program is similar to program 1: the user is asked to enter values, calculations are performed, and results of the calculations are displayed.

Program 1 asked the user to enter the program average. This program should ask the user for the sum of the program points that were earned. This value should be an integer.

Program 1 asked the user to enter the test average. This program should ask the user for the sum of the quiz scores and sum of the test scores. Both of the values should be integers.

The program average is calculated by taking the sum of the program points that were earned, dividing it by the maximum number of program points (see Symbolic Constants below), and multiplying by 100.

The test average is calculated by adding the sum of the quiz scores and sum of the test scores. The resulting sum should be divided by the maximum number of test and quiz points (see Symbolic Constants below) and then multiplied by 100.

As with program 1, use the calculated program and test averages to calculate the course average and then display it.

Symbolic Constants

This program MUST use at least 2 symbolic constants.

One constant is for the maximum number of program points. It should have an integer value of 900.

The other constant is for the maximum number of test and quiz points. It should have an integer value of 400.

More symbolic constants may be added to the code if necessary.

Program Requirements

  1. At the top of the C++ source code, include a documentation box that resembles the one from program 1. Make sure the Date Due and Purpose are updated to reflect the current program.

  2. Include line documentation. There is no need to document every single line, but logical "chunks" of code should be preceded by a line or two that describes what the "chunk" of code does. This will be a part of every program that is submitted for the remainder of the semester.

  3. The calculated averages should be displayed with exactly 2 digits after the decimal point, including zeroes.

  4. The three averages (program, test, and course) should all be type float or double. The values entered by the user (the sum of the program points, sum of the quiz scores, and sum of the test scores) should all be type integer. Make sure to use meaningful variable names.

  5. The program MUST use the 2 symbolic constants described above.

  6. Make sure to test the program with values other than the ones shown in the output below.

  7. Hand in a copy of the source code (the CPP file) using Blackboard.

Output

A few runs of the program should produce the following results:

Run 1

Enter the sum of the program points earned: 785

Enter the sum of the quizzes: 99
Enter the sum of the tests: 268

***************************
      Grade Calculator

Program Average       87.22
Test Average          91.75

Course Average        90.39
***************************

Run 2

Enter the sum of the program points earned: 900

Enter the sum of the quizzes: 100
Enter the sum of the tests: 300


***************************
      Grade Calculator

Program Average      100.00
Test Average         100.00

Course Average       100.00
***************************

Run 3

Enter the sum of the program points earned: 465

Enter the sum of the quizzes: 51
Enter the sum of the tests: 184


***************************
      Grade Calculator

Program Average       51.67
Test Average          58.75

Course Average        56.62
***************************