Question: Create a class called Student. Declare two private member fields for a student name (String) and GPA (double). Provide a constructor, get methods and set
Create a class called "Student". Declare two private member fields for a student name (String) and GPA (double). Provide a constructor, get methods and set methods as shown below.
public Student() - set name to "Louie" and GPA to 1.0 public void setName(String n) - set the name public String getName() - return the name public void setGPA(double g) - set the GPA public double getGPA() - return the GPA Disclaimer: this question has been asked once, but was answered incorrectly a long time ago and no corrections have been made
Student.java Load default template... 4 public class Studentf 6 II FIX ME: define two private member fields 8 public Student O 9 18 11 Assign the parameter to the instance field for name* 12 13 public void setName (String n) 14 15 16 17 II FIX ME: Add three more metods 18 19 20 this method does nothing but is needed for testing 1 public static void main(String args[I) //FIX ME: assign parameter to instance field 23
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts

