Question: Exercise Write a program that contains two classes a Main class and a Studentclass: The Student class has three data fields which are: name, GPA,
Exercise
Write a program that contains two classes a Main class and a Studentclass:
The Student class has three data fields which are: name, GPA, and SID. It has a constructor that takes SID as a parameter.
The Main class is used to declare objects from the Student class.
The Main method should take student's data from the console, store them in an object of type Student then display student's data in the console.
IIc class stadent Z
stringnaene;
double GPA;
int SID;
Publicstudent intstD
Simportjava.util Scanmer;
Public class main &
Public static void mair string aryss
ScannerinPad Nel Scanner sistem in ;
Sys tem.ont. Prith Enter studentis STO";
int STDinPat. nextigt ;
Sydem. out. Print wew Students S STDi:?
Programming CS Lecture
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
