Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 madeimage text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

4. What action should Cherita Howard take and why?

Answered: 1 week ago