school/StudentClass/Student.java

46 lines
726 B
Java
Raw Normal View History

2021-01-27 10:39:36 -05:00
/*
*
* Build Student Class
* Private fields
* *String name default to Louie
* *double gpa default to 1.0
*
* Default constructor
*
* Public member methods
**setName() & getName()
**setGPA() & getGPA()
*/
/*
* Comments for submission
*
* It was certainly a bit of a refresher to go back and review
* how classes work in Java. However, no problems. Easy peasy.
* */
public class Student {
private String name;
private double gpa;
public Student() {
this.name="Louie";
this.gpa = 1.0;
}
public void setName(String name) {
this.name = name;
}
public String getName(){
return this.name;
}
public void setGPA(double gpa){
this.gpa = gpa;
}
public double getGPA(){
return this.gpa;
}
}