I need answer for this in java language (netbeans )// thanks a lot -------------
ID: 3676819 • Letter: I
Question
I need answer for this in java language (netbeans )// thanks a lot
---------------------------------------------------------------------------------------------------
Overriding and Overloading
Based on the characteristics of overloading and overriding in the lecture, one of them was that (constructor is able to be overloaded), the other was that (overriding has advantage in providing specific implementation of a method that is already provided by its superclass.)
1- Create two classes; The first called: StudentData, and the second called: CSStudents )
2- The classes are created to provide the structure for three objects of students st1, st2, and st2.
3- Class StudentData defines :
Four of private attributes called (studentID, studentName, courseMark, numberOfHoursInCourse). These attributes have no initialization.
Two of public attributes called (courseGradeNumberOfFive, courseGradeLetterOfFive). These attributes have no initialization.
One Behavior called ( calculateGPA ): To calculate the point of the GPA of 5 for a provided course.
3- Class CSStudents defines :
Three private attributes called (courseName, numberOfHoursInCourse, courseMark).
Two public attributes called (courseGradeLetterOfFour, courseGradeNumberOfFour ).
One Behavior called ( calculateGPA) To calculate the point of the GPA of 4 for a provided course, also it implements the function to calculate the Grade for the point of 5 and the point of 4 as well.
4- Show the ability of the constructor for overloading by using two constructors:
One to initialize studentID, studentName.
One to initialize studentID, studentName, courseName, courseMark, numberOfHoursInCourse
6- Show the advantage of the overriding in providing its specific implementation of calculateGPA method in class CSStudents , that is already provided by class StudentData.
7- Implement the three objects from the second class.
8- Display the structure for three objects from the main class to get as same as output below.
9- You may need more instance methods to complete your homework.
10- You may need more Overriding methods to complete your homework.
11- Provide your code and the implementation in Java code.
OUTPUT
Student ID : 111
Student Name : Amani
Course Name : Graphics
Course Mark : 100
Number of hours : 4
Point for the GPA of 4 is : 16.0 and the grade is A+
Point for the GPA of 5 is : 20.0 and the grade is A+
*************************
Student ID : 222
Student Name : Tahani
Course Name : Networks
Course Mark : 75
Number of hours : 4
Point for the GPA of 4 is : 10.0 and the grade is C+
Point for the GPA of 5 is : 14.0 and the grade is C+
*************************
Student ID : 333
Student Name : Soaad
Course Name : Programming 3
Course Mark : 50
Number of hours : 3
Point for the GPA of 4 is : 0.0 and the grade is F
Point for the GPA of 5 is : 0.0 and the grade is F
Hints
Mark
To calculate the point
for GPA of 4
To calculate the point for GPA of 4
95 - 100
4 * number of hours in course
5 * number of hours in course
90 - 94
3.75 * number of hours in course
4.75 * number of hours in course
85 - 89
3.5 * number of hours in course
4.5 * number of hours in course
80 - 84
3 * number of hours in course
4 * number of hours in course
75 -79
2.5 * number of hours in course
3.5 * number of hours in course
70 - 74
2 * number of hours in course
3 * number of hours in course
65 - 69
1.5 * number of hours in course
2.5 * number of hours in course
60 - 64
1 * number of hours in course
2 * number of hours in course
Less than 60
0* number of hours in course
0* number of hours in course
Mark
To calculate the point
for GPA of 4
To calculate the point for GPA of 4
95 - 100
4 * number of hours in course
5 * number of hours in course
90 - 94
3.75 * number of hours in course
4.75 * number of hours in course
85 - 89
3.5 * number of hours in course
4.5 * number of hours in course
80 - 84
3 * number of hours in course
4 * number of hours in course
75 -79
2.5 * number of hours in course
3.5 * number of hours in course
70 - 74
2 * number of hours in course
3 * number of hours in course
65 - 69
1.5 * number of hours in course
2.5 * number of hours in course
60 - 64
1 * number of hours in course
2 * number of hours in course
Less than 60
0* number of hours in course
0* number of hours in course
Explanation / Answer
Please find the code below:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.