Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

What is Constitution, Political System and Public Policy? In India

Answered: 1 week ago

Question

What is Environment and Ecology? Explain with examples

Answered: 1 week ago

Question

7. Where Do We Begin?

Answered: 1 week ago