Question: In a class student grade is evaluated by taking an average of the marks of different courses. Write a java program to find grade of student by calculating the average of the marks using the concept of method overloading based on the following instructions. Save the project/file as GradeYourID. A) Class name: Marks_YourFirstName Member variables: studentID, studentName Member Method: – Constructor to initialize member variables – to calculate and return grade with two course marks. grade = (mark1+ mark2) / 2 – to calculate and return grade with three course marks. grade = (mark1+ mark2 + mark3) / 3 – to calculate and return grade with four course marks. grade = (mark1+ mark2 + mark3 + mark4) / 4 B) Controlling class: – To create object of Marks_YourFirstName – To print Student ID and Student Name. – To print grade of the student.
Question:
In a class student grade is evaluated by taking an average of the marks of different courses. Write a java program to find grade of student by calculating the average of the marks using the concept of method overloading based on the following instructions. Save the project/file as GradeYourID.
A) Class name: Marks_YourFirstName
Member variables: studentID, studentName
Member Method:
– Constructor to initialize member variables
– to calculate and return grade with two course marks.
grade = (mark1+ mark2) / 2
– to calculate and return grade with three course marks.
grade = (mark1+ mark2 + mark3) / 3
– to calculate and return grade with four course marks.
grade = (mark1+ mark2 + mark3 + mark4) / 4
B) Controlling class:
– To create object of Marks_YourFirstName
– To print Student ID and Student Name.
– To print grade of the student.
Step by step
Solved in 2 steps