Question: Make a complete Java program as follow: Make two java classes: The first class represents a student and must be named using your first and
Make a complete Java program as follow:
- Make two java classes:
- The first class represents a student and must be named using your first and last name.
- The second class must be named as "Main"with the main method.
- Perform the following in the first class:
- Make three private instance variables to store first name, last name and GPA. Do not assign any values to the variables in this step!
- Make a constructer without parameters to initialize all the instance variables to default values (0 for numbers and "" for a string).
- Make a constructor that can take the first and last name as parameters. Assign the parameters' values to the two instance variables you created earlier (first and last name).
- Create a getName() method to returnthe first and last name. You must return the first and last name in a single string using a plus sign. You must have a space between the first name and last name.
- Create setGPA() and getGPA() methods to store and return your GPA, respectively.
- Perform the following in the main class:
- Create a new object of your first class and pass your first and last name as two parameters.
- Call the getName() method and store the result in a string variable called myFullName.
- Print your full name using the string variable myFullName.
- Set your GPA using the setGPA() method.
- Print your GPA using the getGPA() method.
Note:
- Your answer should have the code as text as well as the screenshot of the program output (using your own name) as a part of your answer. Otherwise, zero marks will be awarded.
Typical run of the program

Compile Messages jGRASP Messages Run 1/0 Interactions End jGRASP exec: java Main Clear My name is Khaled Saleh My GPA is 3.2 Help -jGRASP: operation complete. L
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
