The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 431 Weeks Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Create a constructor for the Student class you created. The constructor should initialize each Student's ID number to 9999, his or her points earned to 12, and credit hours to 3 (resulting in a grade point average of 4.0). Write a program that demonstrates that the constructor works by instantiating an object and displaying the initial values. Save the application as ShowStudent2.java
Here's the Student class:
public class Student {
private int ID;
private int creditHours;
private int pointsEarned;
double GPA;
public Student()
{
}
public Student(int id,int hrs, int pts)
{
ID=id;
creditHours=hrs;
pointsEarned=pts;
}
public double getGPA()
{
return GPA;
}
public void setGPA()
{
GPA = (double) pointsEarned / creditHours;
}
public void setID(int number)
{
ID = number;
}
public int getID()
{
return ID;
}
public void setCreditHours(int hours)
{
creditHours = hours;
}
public int getCreditHours()
{
return creditHours;
}
public void setPointsEarned(int points)
{
pointsEarned = points;
}
public int getPointsEarned()
{
return pointsEarned;
}
}
Thank you!
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- -----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------