Build the Student class with the following specifications: Private fields String name - Initialized in default constructor
Fantastic news! We've Found the answer you've been seeking!
Question:
Build the Student class with the following specifications:
- Private fields
- String name - Initialized in default constructor to "Louie"
- double gpa - Initialized in default constructor to 1.0
- Default constructor
- Constructor with parameters (name and gpa of a student is passed to it)
- Public member methods
- setName() & getName()
- setGPA() & getGPA()
Complete TestStudent class to test the Student class.
- Prompt user for a student name and GPA
- Add a new student object whose name and GPA were entered from keyboard
- Print the details using the same format as given in the sample
- Set Nancy's GPA equal to Felix's GPA using the get method
- Modify the name by adding Brown to the Nancy Jones
- Print the details of the updated object using the same format as given in the sample
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date: