Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA: 1) Define a class Student that will hold the following information: studentID, firstName, lastName, and grade. Create a constructor to fill in each

IN JAVA:

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.

Make sure your class name is Student, and the method name is submitAssignment. Don't submit screenshots, and be sure to double check your work runs.

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.

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

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

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

ISBN: 978-0764535376

More Books

Students also viewed these Databases questions