Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions