CSCI 240 Program 1 Arithmetic calculate a course average solution




5/5 - (6 votes)

Write a program to calculate a course average in the CSCI 240 course. This program will be used as a starting point for the next few assignments so it is important that it is completed and completed correctly.

  • prompt the user for the program average. This is a double/float value that should be stored in a double/float variable.
  • prompt the user for the test average. This is a double/float value that should be stored in a double/float variable.
  • calculate the course average as the sum of 30% of the program average and 70% of the test average
  • display the course average as shown in the sample output below

Program Requirements

    1. At the top of your C++ source code, include a documentation box that resembles the following, making sure to put your name after the “Programmer” label, the section of CSCI 240 that you’re in after the “Section” label, and the due date for the program after the “Date Due” label. A box similar to this one will be put in EVERY source code file that is handed in this semester.

Note: DO NOT put this box within cout statements. It should NOT be displayed as part of the output from the program.:

CSCI 240         Program 1     Fall 2017



Date Due:

Purpose: This program calculates and displays a course average for
         the CSCI 240 course.
    1. Include the following lines of code BELOW the documentation box:
#include <iostream>
#include <iomanip>

using namespace std;
  1. Use type float or double for the three averages. Use meaningful variable names.
  2. Make sure and test your program with values other than the ones supplied in the sample output. Double check the validity of the results using a calculator.
  3. Hand in a copy of the source code (the .cpp file) on Blackboard.

Sample Output:

A single run of the program should resemble the following:

Enter the program average: 75.26
Enter the test average: 52.31

Grade Calculator

Program Average  75.26
Test Average     52.31

Course Average   59.195

Use various cout statements to make the line (of *’s) as well as the text. Be sure that the amounts are lined up vertically as shown.