Question: Create a Java project called Lab8-Q1. Inside this project create a class named Q1 with a main function. Also create a class named Student. The
Create a Java project called Lab8-Q1. Inside this project create a class named "Q1" with a
main function. Also create a class named "Student".
The main function should have the following lines of code:
Student Corey = new Student("Corey Park", 4.0, 90);
Student Don = new Student("Don Draper", 3.6, 60);
Corey.displayStudentProfile();
Don.displayStudentProfile();
And the program should output the following:
First Name: Corey
Last Name: Park
GPA: 4.0
Year: Senior
First Name: Don
Last Name: Draper
GPA: 3.6
Year: Junior
The class Student should have the following variables.
private String fullName;
private String firstName;
private String lastName;
private String gradeYear;
private double gpa;
private int creditsComplete;
The constructer will initialize the variables, fullName, gpa and creditsComplete.
The constructer will also parse the the students fullName and split it into the variables
firstName and lastName based on white space.
The constructor will use the number of credits completed to compute if the student is a
Freshmen (less then 30 credits), Sophomore (less then 60 credits), Junior (less then 90 credits),
or a Senior.
The class Student should have a method displayStudentProfile() that prints to the standard
output the students First Name, Last Name, GPA, and Year.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
