Answered step by step
Verified Expert Solution
Question
1 Approved Answer
/ * - - - - - - - - - - - - - - - - - - - - - - -
AUTHOR:
SPECIFICATION: This program is for practicing the use of classes, constructors,
helper methods, and the this operator.
INSTRUCTIONS: Read the following code skeleton and add your own code
according to the comments
import java.util.Scanner;
public class
public static void mainString args
Let's make two students using all two constructors
Write code to create a new student alice using constructor #
Student alice
Write code to create a new student bob with name "Bob Brown",
age and GPA using constructor #
Let's get user input to change the missing or default values
Scanner scan new ScannerSystemin;
Get user input and set Alice's full name
System.out.printEnter full name for Alice: ;
alice.setNamescannextLine;
Get user input and set Alice's age
Write code to get user input and set Alice's GPA
Lets print out the students details
alice
bob
System.out.printlnr
Changing Bob's GPA";
Get user input and change bob's gpa
Write code to print out bob's new details
System.out.printlnr
Comparing Alice and Bob";
Student better alice.betterGPAbob;
System.out.printlnbettergetName has a better GPA";
Use the olderStudent method to figure out which student is
older between Alice and Bob. Then print out the result. Follow
the betterGPA example above.
Finally, print out each student's details times, using the printint n method
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started