JAVA PROGRAMMING, i just need the testdriver of the mentioned class and also the
ID: 3755675 • Letter: J
Question
JAVA PROGRAMMING, i just need the testdriver of the mentioned class and also the main program. I have written down the required class. needed TESTDRIVER AND MAIN PROGRAM
Develop a Student class as a subclass of the Person class from lab 2 that contains the following additional values than those inherited from the Person class:
earned_credits (total number of earned credits)
gpa (current overall GPA)
major
Include in the class:
appropriate constructor
getter methods
toString method
getStatus (freshman, sophomore, junior, senior)
onDeansList (returns true if GPA >= 3.4)
Freshman status (0-30 earned credits), sophomore (31-60), etc.
2. Develop a test driver for the class.
3. Develop a main program that:
allows the user to enter the information for a number of students
creates objects of type Student and stores in an array (of type Students[])
allows the user to display the information of the student with the highest gpa
Explanation / Answer
import java.util.Scanner; public class StudentDemo { public static void main(String args[]) { Scanner input = new Scanner(System.in); System.out.println("Enter number of students: "); int n = Integer.parseInt(input.nextLine()); Student students[] = new Student[n]; for(int i=0; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.