Question: In JAVA Create a class that can be used to store grades for a single student for the fictional class CS-101. The grades for CS-101
In JAVA
Create a class that can be used to store grades for a single student for the fictional class CS-101. The grades for CS-101 are based on four exam scores, 5 project scores, 5 lab scores, and 5 quiz scores. The grades for The class should allow for the following: 1. Information to be stored: a. Storing four exam grades. Each exam has a default score of 0. b. Storing 5 project scores. Each project has a default score of 0. c. Storing 5 lab scores. Each lab has a default score of O. d Storing Squiz scores. Each quiz has a default score of O. e. The class should allow for the possibility that exam scores are dropped (1.e. not used in final grade computation). Exams should not be dropped by default. Hint: use four boolean values. f. All class attributes should be private and non-static 2 Interface a. The class should be called CS101Gradebook. b. double getExamScore(int examNum) - Returns the score for exam 1.2, 3, or 4 depending on the value of examNum. If examNum is not within the range (1.4) finclusive), this method should return -1. c void setExamScore(int examNum, double score) - Sets score for exam 1, 2, 3. or 4 to the value of score depending on the value of examNum. If examNum is not within the range [1,4] (inclusive) or if score is not within the range [0.0, 100.0] inclusive, this method does not change any exam scores. d. void toggle DropExam(int examNum) - Toggles the drop state for exam 1. 2. 3, or 4 depending on the value of examNum. If examNum is outside the range [1, 4] (inclusive) this method should not do anything. Toggling the drop state means setting the boolean value indicating whether a particular exam is dropped to the opposite of its current state. I.e. if the exam was not dropped before calling this method, it should be dropped after and if the exam was dropped before calling the method, it should not be dropped after. e. double getExamAverage() - Return the average exam score. This average should be calculated without any dropped exams. If all four exams are dropped. this method should return 0 f. double getProjectScore(int projectNum) - Retums the score for project 1, 2, 3, 4 or 5 depending on the value of projectNum. If projectNum is not within the range (1,5) (inclusive), this method should return -1. g. void setProjectScore(int projectNum, double score) - Sets the score for project 1. 2, 3, 4, or 5 to the value of score depending on the value of projectNum. If projectNum is not within the range (1,5) (inclusive) or if score is not within the range [0,0,100.0] inclusive, this method does not change any project scores h. double getProjectAverage() - Returns the average project score i double getLabScore(int projectNum) - Returns the score lab 1, 2, 3, 4 or 5 depending on the value of labNum. If labNum is not within the range (1,5) (inclusive), this method should return -1. void setLabScore(int labNum, double score) - Sets the score for lab 1, 2, 3, 4, or 5 to the value of score depending on the value of labtNum. If labNum is not within the range (1,5) (inclusive) or if score is not within the range (0.0, 100.0] inclusive. this method does not change any lab scores
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
