Question
Write a class that represents a student. Every student has a name, an id number, a number of credits, and a number of grade points.
Write a class that represents a student. Every student has a name, an id number, a number of credits, and a number of grade points.
Also, include in your class a default constructor, a second constructor with all parameters, an accessor method (getter) for the student name, and a method called gpa that will calculate and return the students grade point average. (Hint: gpa = points/credits)
II. Using the class that you just wrote, answer the following questions.
Write code that will declare and initialize an object using the default constructor.
Write code that will declare and initialize an object using the overloaded constructor.
Write code that will retrieve and print the students gpa from #2.
java basic programming simple as possible use import java.util.*; thanks in advance
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