My computer science class has this very specific homework assignment and I don't understand how to do all of it.
Write a program that will calculate the average score and letter
grade earned by a student in any course. The program should allow the user to enter the student’s name. It should
also prompt for the number of exams taken by the student and the score earned for each exam. Calculate the
average and letter grade earned. Display the student’s name, average, and letter grade. (You must use functions in
your source code.)
a. Use main( ) as the driver function. Allow the user to run the program as many times as desired.
b. Write the function getStudentName() that prompts the user for the name of the student and returns it back to
main().
c. Write the function getNumberExams( ) that prompts the user for the total number of exams taken by the student
in the course and returns this value back to main( ). Do not allow the user to enter a value less than one for the
number of exams. Display an error message and keep prompting until a valid value is entered.
d. Write the function getScoresAndCalculateTotal( ) to determine the total score of the exams take by the student.
Use a loop to prompt for each exam score and accumulate the total as the user enters the scores. Return the
calculated total back to main( ).
e. Write the function calculateAverage( ) to determine the average grade earned by the student and return this
value back to main( ).
f. Write the function determineLetterGrade( ) that determines the letter grade earned by the student for the course
and returns this back to main( ).
g. Write the function displayAverageGrade( ) to display the student’s name, the average (to the nearest tenth of a
decimal) and letter grade earned by the student.
How do I get going past this?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#include <iostream>
#include <string>
using namespace std;
string getStudentName(string a, string b);
void getNumberExams();
void getScoresandCalculateTotal();
void calculateAverage();
void determineLetterGrade();
void displayAverage();
int main()
{
getStudentName(string a, string b);
getNumberExams();
getScoresandCalculateTotal();
calculateAverage();
determineLetterGrade();
displayAverage();
}
string getStudentName(string& a, string& b)
{
}
void getNumberExams(int &test)
{
}
void getScoresandCalculateTotal()
{
}
void calculateAverage()
{
}
void determineLetterGrade()
{
}
void displayAverage()
{
}
|