Question: 4 . Write a C + + program that prompts the user to enter the name, surname, Test 1 mark, and Test 2 mark of

4. Write a C++ program that prompts the user to enter the name, surname, Test 1 mark, and Test 2 mark of a student. The program should then use three functions: calculateAverage, gradeAverage, and printDetails as follows:
calculateAverage: This function should take two integer parameters representing the Test 1 mark and Test 2 mark and return the average of the two marks as a double.
gradeAverage: This function should take the average mark as a parameter and return a string indicating whether the student has passed or failed. If the average mark is greater than or equal to 50, the function should return "Passed"; otherwise, it should return "Failed".
printDetails: This function should take the student's name, surname, Test 1 mark, Test 2 mark, average mark, and grade as parameters and display these details to the console. This function is a void function.Write a C++ program that prompts the user to enter the name, surname, Test 1 mark, and
Test 2 mark of a student. The program should then use three functions: calculateAverage,
gradeAverage, and printDetails as follows:
I. calculateAverage: This function should take two integer parameters representing the
Test 1 mark and Test 2 mark and return the average of the two marks as a double.
II. gradeAverage: This function should take the average mark as a parameter and return
a string indicating whether the student has passed or failed. If the average mark is
greater than or equal to 50, the function should return "Passed"; otherwise, it should
return "Failed".
III. printDetails: This function should take the student's name, surname, Test 1 mark, Test
2 mark, average mark, and grade as parameters and display these details to the
console. This function is a void function.
 4. Write a C++ program that prompts the user to enter

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!