Question: Write a public class named Student. The Student class should have a static variable, numStudent, and five instance variables. Write the following variables: Static variable:
Write a public class named Student. The Student class should have a static variable, numStudent, and five instance variables. Write the following variables: Static variable: numStudent: the number of the student objects that have been created, static, int, initial value Instance variables: name: the students full name, String, egJohn Doe must be specified when instantiated. id: the students id ineger, created based on numStudent, eg the first student objects id should be the second student objects id should be major: the students major, String, must be specified when instantiated. gpa: the student's current gpa, double, must be specified when instantiated. Write the constructor Write a public getset method for each instance variable Write a public method called scholarship that can determine if a student is qualified for a STEM scholarship. If the students gpa is greater than and their major is either Mathematics, Cybersecurity, or Computer Science, return true. Otherwise, return false. Write the main method to run each method with the provided test case. Test cases: Student s new StudentJohn DoeComputer Science; id is username is jdoe Student s new StudentEmily JohnsonBusiness; id is username is ejohns For each object, call scholarship
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
