Question: Build the Student class with the following specifications: Private fields String name - Initialized in default constructor to Louie double gpa - Initialized in default

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

Step by Step Solution

3.49 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javautilScanner public class Student private String name Louie private double gpa 10 public S... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!