You are on page 1of 1

FRIEND FUNCTION EXERCISE

Q1. By using a class called student, write a C++ program that uses a friend function
Grader() to calculate the sum, the mean and the percentage of the marks of students in
5 courses namely Visual Basic (vb), C++ programming (cpp), web design (wd),
mathematics (math) and physics (phy). The User shall be asked the number of students
s/he will record then the program asks him/her to enter the name, surname of the
students, and the marks obtained by each student in 5 courses, the program will
calculate the sum, mean and the percentage, then using a friend function Display ()
displays on the screen the name, surname, mean and percentage of each student.

N.B: The students Marks must be kept in the instance variables of the class
student and use a member Function GetMarks() to receive the marks from
the user.

You might also like