Question
Part I: Design a class named Student. The class contains: . Private data fields, including first name, last name and GPA . Getter and setter
Part I: Design a class named Student. The class contains:
. Private data fields, including first name, last name and GPA
. Getter and setter methods for all data fields
. A method named toString that returns student information in the following format:
first name last name GPA .
A non-parameter constructor (assign initial values of your choice) .
A constructor that creates a student with name and GPA.
Part II: Tester-Write a tester program named Tester1.java to perform the following tasks:
. create three students
. calculate average GPA for the three students
. display three students records
. display the average GPA ( a separate line)
Part III: revise the driver class (a separate file named Tester2.java) as follows:
. Read a data file and construct students from the data file
. Print students (name and GPA) .
The file student.txt will contain several students information as follows:
Smith Davis 3.6
Johnson Kanet 3.0
Williams Carl 3.8
Jones Brown 3.3
Steve Davis 3.0 .
Smaple program output
---------------------------------
Student Name | GPA
--------------------- | --------
Smith Davis | 3.6
Johnson Kanet | 3.0
Williams Carl | 3.8
Jones Brown | 3.3
Steve Davis | 3.0
------------------------------
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