-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentsProfile.java
More file actions
35 lines (23 loc) · 1022 Bytes
/
Copy pathStudentsProfile.java
File metadata and controls
35 lines (23 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class StudentsProfile {
String firstname;
String lastname;
String declaredmajor;
double gpa;
int expectedyeartograduate;
public StudentsProfile(String firstname, String lastname, String declaredmajor, double gpa, int expectedyeartograduate){
this.firstname = firstname;
this.lastname = lastname;
this.declaredmajor = declaredmajor;
this.gpa = gpa;
this.expectedyeartograduate = expectedyeartograduate;
}
public void incrementexpectedgraduationyear(){
this.expectedyeartograduate = this.expectedyeartograduate+1;
}
public static void main(String[] args) {
StudentsProfile profileone= new StudentsProfile("Sally","Salmon","Film",3.75,2022 );
StudentsProfile profiletwo = new StudentsProfile("Max", "Tiffen", "Computer Science", 3.45,2021);
profiletwo.incrementexpectedgraduationyear();
System.out.println(profiletwo.expectedyeartograduate);
}
}