1
answer
0
watching
87
views

In this lab you will define a structure definition called Student, which will contain a string for the student’s name, and an integer array of size 3 called tests that will hold the values of that particular student’s test scores. You will write a user controlled looping program that will instantiate a Student object, prompt the user for the student’s name, and enter the student’s three test scores. The program will then display the student’s name, followed by the three test scores, the average of the tests up to 1 decimal point, and the corresponding letter grade. Then ask the user to type in “Y” if the user wishes to enter another student (then repeat), otherwise end the loop and let the program close. Define and use the following functions with in your program: Student getStudent(); - This function will create a temporary Student object, prompt the user for the student’s name and input in the the object’s member string variable. Then prompt for three test scores and enter into the object’s integer array tests for each score, validating that the score is with in 0..100. Then return the temporary object. void displayStudent(const Student &s); - This function will access and print out the passed student’s name and then call displayStudentDetails function. void displayStudentDetails(const int[], const int); - This function will pass the student’s tests array and the amount of tests the student has taken. This function will traverse the passed array, keeping a running total for each test score value and outputting each test score. This function will then call calcAverage passing the accumulated total and the number of tests the student has taken, assigning the returned value to a local double variable called avg. Display the avg up to 1 decimal point. Finally, call the function displayStudentLetterGrade passing the returned value avg. double calcAverage(const Student, int count); - This function will calculate and return the quotient of the total / count. (hint: remember to typecast as a double in order to return a double) doub le calcAverage(int total, int count); - This function will calculate and return the quotient of the total / count. (hint: remember to typecast as a double in order to return a double) void displayStudentLetterGrade(double avg); - This function will display the corresponding letter grade value given the passed avg. If the avg is >= 90 then print to the screen “A” … and so on. Expert Answer

For unlimited access to Homework Help, a Homework+ subscription is required.

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in

Related questions

Weekly leaderboard

Start filling in the gaps now
Log in