Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package cis35a.project4.JoshBiso;
- 002
- import java.util.Scanner;
- 003
- import java.util.ArrayList;
- 004
- import java.util.Date;
- 005
- 006
- class Student {
- 007
- private Scanner in = new Scanner(System.in);
- 008
- private String studentName;
- 009
- private long studentID;
- 010
- private String address;
- 011
- private String phone;
- 012
- private boolean fulltimeStatus;
- 013
- private float gpa;
- 014
- private ArrayList courseList;
- 015
- 016
- public Student(){
- 017
- }
- 018
- public Student(String studentName, long studentID){
- 019
- this.studentName=studentName;
- 020
- this.studentID=studentID;
- 021
- }
- 022
- public Student(String studentName, long studentID, String address, String phone, boolean fulltimeStatus, float gpa){
- 023
- this.studentName = studentName;
- 024
- this.studentID= studentID;
- 025
- this.address=address;
- 026
- this.phone=phone;
- 027
- this.fulltimeStatus= fulltimeStatus;
- 028
- this.gpa=gpa;
- 029
- }
- 030
- 031
- 032
- 033
- 034
- public void setStudentName(String studentName){
- 035
- this.studentName=studentName;
- 036
- 037
- }
- 038
- public void setStudentID(long studentID){
- 039
- this.studentID=studentID;
- 040
- }
- 041
- public void setAddress(String address){
- 042
- this.address=address;
- 043
- }
- 044
- public void setPhone(String phone){
- 045
- this.phone=phone;}
- 046
- 047
- public boolean setfulltimeStatus(boolean fulltimeStatus){
- 048
- if(courseList.size()>=3){
- 049
- this.fulltimeStatus=fulltimeStatus;
- 050
- System.out.print("Fulltime Student");
- 051
- return true;
- 052
- }
- 053
- else {
- 054
- this.fulltimeStatus=fulltimeStatus;
- 055
- System.out.print("Parttime Student");
- 056
- return false;}
- 057
- 058
- }
- 059
- public void setGpa(float gpa){
- 060
- for(int i=1;i<=courseList.size();i++){
- 061
- }
- 062
- 063
- 064
- }
- 065
- public void setCourseList(EnrolledCourse className){
- 066
- 067
- this.courseList.add(className);}
- 068
- 069
- public String getStudentName(){
- 070
- studentName=in.next();
- 071
- return studentName;
- 072
- }
- 073
- public boolean getFulltimeStatus(){
- 074
- return fulltimeStatus;
- 075
- }
- 076
- public long getID(){
- 077
- return studentID;
- 078
- }
- 079
- 080
- public String getAddress(){
- 081
- return address;
- 082
- }
- 083
- 084
- public String getPhone(){
- 085
- return phone;
- 086
- }
- 087
- 088
- public boolean getStatus(){
- 089
- 090
- return true;
- 091
- }
- 092
- public float getGPA(){
- 093
- return gpa;
- 094
- }
- 095
- 096
- public ArrayList getCourseList(){
- 097
- 098
- return courseList;
- 099
- }
- 100
- 101
- public boolean addCourse(EnrolledCourse courseName){
- 102
- for(int i=1; i<courseList.size();i++){
- 103
- if(!courseList.contains(courseName)){
- 104
- courseList.add(i);
- 105
- return true;
- 106
- 107
- }
- 108
- }
- 109
- return false;
- 110
- }
- 111
- 112
- 113
- 114
- public boolean dropCourse(int callNumber){
- 115
- 116
- if(courseList.contains(callNumber)){
- 117
- courseList.remove(callNumber);
- 118
- return true;
- 119
- }
- 120
- return false;
- 121
- }
- 122
- 123
- public boolean updateGrade(int callNumber, char newGrade){
- 124
- if(courseList.contains(callNumber)){
- 125
- 126
- 127
- return true;}
- 128
- return false;}
- 129
- //public char getCourseGrade(String courseName){
- 130
- 131
- //}
- 132
- public String hasEnrolled(String courseName){
- 133
- return courseName;
- 134
- }
- 135
- 136
- }
Advertisement
Add Comment
Please, Sign In to add comment