Question: Student.cpp // This program will input an undetermined number of student names // and a number of grades for each student. The number of grades

 Student.cpp // This program will input an undetermined number of student
Student.cpp
// This program will input an undetermined number of student names
// and a number of grades for each student. The number of grades is
// given by the user. The grades are stored in an array.
// Two functions are called for each student.
// One function will give the numeric average of their grades.
// The other function will give a letter grade to that average.
// Grades are assigned on a 10 point spread.
// 90-100 A 80-89 B 70-79 C 60-69 D Below 60 F
#include
#include
using namespace std;
const int MAXGRADE = 25; // maximum number of grades per student
const int MAXCHAR = 30; // maximum characters used in a name
typedef char StringType30[MAXCHAR + 1]; // character array data type for names
// having 30 characters or less.
typedef float GradeType[MAXGRADE]; // one dimensional integer array data type
float findGradeAvg(GradeType, int); // finds grade average by taking array of
// grades and number of grades as parameters
char findLetterGrade(float); // finds letter grade from average given
// to it as a parameter
int main()
{
StringType30 firstname, lastname; // two arrays of characters defined
int numOfGrades; // holds the number of grades
GradeType grades; // grades defined as a one dimensional array
float average; // holds the average of a student's grade
char moreInput; // determines if there is more input
cout
// Input the number of grades for each student
cout
cin >> numOfGrades;
while (numOfGrades > MAXGRADE || numOfGrades
{
cout
cin >> numOfGrades;
}
// Input names and grades for each student
cout
cin >> moreInput;
while (moreInput == 'y' || moreInput == 'Y')
{
cout
cin >> firstname;
cout
cin >> lastname;
for (int count = 0; count
{
cout
// Fill in the input statement to place grade in the array
}
cout
// Fill in code to get and print average of student to screen
// Fill in call to get and print letter grade of student to screen
cout
cout
cin >> moreInput;
}
return 0;
}
//***********************************************************************
// findGradeAvg
//
// task: This function finds the average of the
// numbers stored in an array.
//
// data in: an array of integer numbers
// data returned: the average of all numbers in the array
//
//***********************************************************************
float findGradeAvg(GradeType array, int numGrades)
{
// Fill in the code for this function
}
//***********************************************************************
// findLetterGrade
//
// task: This function finds the letter grade for the number
// passed to it by the calling function
//
// data in: a floating point number
// data returned: the grade (based on a 10 point spread) based on the
// number passed to the function
//
//***********************************************************************
char findLetterGrade(float numGrade)
{
// Fill in the code for this function
}
11:47 Lab 7.2.docx Retrieve program student.epp Exercise 1: Complete the program by filling in the code. (Areas in bold) Run the program with 3 grades per student using the sample data Mary Brown 100 90 90 George Smith 90 30 50 Dale Barnes 80 78 82 Sally Dolittle 70 65 8 Conrad Bailer 60 58 71 You should get the following results: Mary Brown has an average of 93.33 which gives the letter grade of A George Smith has an average of 56.67 which gives the lettier grade of F Dale Barnes ha of B Sally Dolittle has an average grade of C Conrad Bailer has an average grade of D s an average of 80.00 which gives the letter of 71.67 which gives the letter of 63.00 which gives the Open With Print

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!