jaredec18

Untitled

Sep 9th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. package cis35a.project4.JoshBiso;
  2. 002
  3. import java.util.Scanner;
  4. 003
  5. import java.util.ArrayList;
  6. 004
  7. import java.util.Date;
  8. 005
  9.  
  10. 006
  11. class Student {
  12. 007
  13. private Scanner in = new Scanner(System.in);
  14. 008
  15. private String studentName;
  16. 009
  17. private long studentID;
  18. 010
  19. private String address;
  20. 011
  21. private String phone;
  22. 012
  23. private boolean fulltimeStatus;
  24. 013
  25. private float gpa;
  26. 014
  27. private ArrayList courseList;
  28. 015
  29.  
  30. 016
  31. public Student(){
  32. 017
  33. }
  34. 018
  35. public Student(String studentName, long studentID){
  36. 019
  37. this.studentName=studentName;
  38. 020
  39. this.studentID=studentID;
  40. 021
  41. }
  42. 022
  43. public Student(String studentName, long studentID, String address, String phone, boolean fulltimeStatus, float gpa){
  44. 023
  45. this.studentName = studentName;
  46. 024
  47. this.studentID= studentID;
  48. 025
  49. this.address=address;
  50. 026
  51. this.phone=phone;
  52. 027
  53. this.fulltimeStatus= fulltimeStatus;
  54. 028
  55. this.gpa=gpa;
  56. 029
  57. }
  58. 030
  59.  
  60. 031
  61.  
  62. 032
  63.  
  64. 033
  65.  
  66. 034
  67. public void setStudentName(String studentName){
  68. 035
  69. this.studentName=studentName;
  70. 036
  71.  
  72. 037
  73. }
  74. 038
  75. public void setStudentID(long studentID){
  76. 039
  77. this.studentID=studentID;
  78. 040
  79. }
  80. 041
  81. public void setAddress(String address){
  82. 042
  83. this.address=address;
  84. 043
  85. }
  86. 044
  87. public void setPhone(String phone){
  88. 045
  89. this.phone=phone;}
  90. 046
  91.  
  92. 047
  93. public boolean setfulltimeStatus(boolean fulltimeStatus){
  94. 048
  95. if(courseList.size()>=3){
  96. 049
  97. this.fulltimeStatus=fulltimeStatus;
  98. 050
  99. System.out.print("Fulltime Student");
  100. 051
  101. return true;
  102. 052
  103. }
  104. 053
  105. else {
  106. 054
  107. this.fulltimeStatus=fulltimeStatus;
  108. 055
  109. System.out.print("Parttime Student");
  110. 056
  111. return false;}
  112. 057
  113.  
  114. 058
  115. }
  116. 059
  117. public void setGpa(float gpa){
  118. 060
  119. for(int i=1;i<=courseList.size();i++){
  120. 061
  121. }
  122. 062
  123.  
  124. 063
  125.  
  126. 064
  127. }
  128. 065
  129. public void setCourseList(EnrolledCourse className){
  130. 066
  131.  
  132. 067
  133. this.courseList.add(className);}
  134. 068
  135.  
  136. 069
  137. public String getStudentName(){
  138. 070
  139. studentName=in.next();
  140. 071
  141. return studentName;
  142. 072
  143. }
  144. 073
  145. public boolean getFulltimeStatus(){
  146. 074
  147. return fulltimeStatus;
  148. 075
  149. }
  150. 076
  151. public long getID(){
  152. 077
  153. return studentID;
  154. 078
  155. }
  156. 079
  157.  
  158. 080
  159. public String getAddress(){
  160. 081
  161. return address;
  162. 082
  163. }
  164. 083
  165.  
  166. 084
  167. public String getPhone(){
  168. 085
  169. return phone;
  170. 086
  171. }
  172. 087
  173.  
  174. 088
  175. public boolean getStatus(){
  176. 089
  177.  
  178. 090
  179. return true;
  180. 091
  181. }
  182. 092
  183. public float getGPA(){
  184. 093
  185. return gpa;
  186. 094
  187. }
  188. 095
  189.  
  190. 096
  191. public ArrayList getCourseList(){
  192. 097
  193.  
  194. 098
  195. return courseList;
  196. 099
  197. }
  198. 100
  199.  
  200. 101
  201. public boolean addCourse(EnrolledCourse courseName){
  202. 102
  203. for(int i=1; i<courseList.size();i++){
  204. 103
  205. if(!courseList.contains(courseName)){
  206. 104
  207. courseList.add(i);
  208. 105
  209. return true;
  210. 106
  211.  
  212. 107
  213. }
  214. 108
  215. }
  216. 109
  217. return false;
  218. 110
  219. }
  220. 111
  221.  
  222. 112
  223.  
  224. 113
  225.  
  226. 114
  227. public boolean dropCourse(int callNumber){
  228. 115
  229.  
  230. 116
  231. if(courseList.contains(callNumber)){
  232. 117
  233. courseList.remove(callNumber);
  234. 118
  235. return true;
  236. 119
  237. }
  238. 120
  239. return false;
  240. 121
  241. }
  242. 122
  243.  
  244. 123
  245. public boolean updateGrade(int callNumber, char newGrade){
  246. 124
  247. if(courseList.contains(callNumber)){
  248. 125
  249.  
  250. 126
  251.  
  252. 127
  253. return true;}
  254. 128
  255. return false;}
  256. 129
  257. //public char getCourseGrade(String courseName){
  258. 130
  259.  
  260. 131
  261. //}
  262. 132
  263. public String hasEnrolled(String courseName){
  264. 133
  265. return courseName;
  266. 134
  267. }
  268. 135
  269.  
  270. 136
  271. }
Advertisement
Add Comment
Please, Sign In to add comment