Question: Question 1 Define a class Student that will hold the following information: studentID, firstName, lastName, and grade. Create a constructor to fill in each variable
Question 1
Define a class Student that will hold the following information: studentID, firstName, lastName, and grade. Create a constructor to fill in each variable except for grade, which will default to 0. Define a method in Student called submitAssignment. We should be able to call submitAssignment with either 1 argument, grade, or 2 arguements, grade and latePenalty. The first implementation of submitAssignment with 1 argument should replace the current grade. The second implementation of submitAssignment with 2 arguments should replace the current grade with the grade minus the latePenalty.
Question 2
Define a class School that has a static field minimumGrade set to 50. Define a static method in School called checkPassing. The method checkPassing should take in 1 parameter which is Student. The method will check if a student has passed or failed by comparing their grade with the minimumGrade and print out pass or fail.
Question 3
Initialize a student object, call submitAssignment on it with a grade of 77, and use the static method checkPassing to print out the result. Initialize another student object, call submitAssignment on it with a grade of 66 and a penalty of 20, and use the static method checkPassing to print out the result.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
