Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions