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 =0. Instance variables: name: the students full name, String, e.g.,John Doe, must be specified when instantiated. id: the students id, ineger, created based on numStudent, e.g., the first student objects id should be 1, the second student objects id should be 2. 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 get/set 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 3.8 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 s1= new Student(John Doe,Computer Science,3.4); // id is 1, username is jdoe1 Student s2= new Student(Emily Johnson,Business,3.9); // id is 2, username is ejohns2 For each object, call scholarship().

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!