Question: Q3 Answer Q3(a)-Q3(e) based on the information given in Figure Q3. GradedActivity -score: double +set Score (s: double):void +get Score () : double +getGrade(): char

 Q3 Answer Q3(a)-Q3(e) based on the information given in Figure Q3.GradedActivity -score: double +set Score (s: double):void +get Score () : double+getGrade(): char FinalExam -numQuestions:int -pointsEach:double -numMissed:int +FinalExam (questions:int, missed:int) +get Points(): double

Q3 Answer Q3(a)-Q3(e) based on the information given in Figure Q3. GradedActivity -score: double +set Score (s: double):void +get Score () : double +getGrade(): char FinalExam -numQuestions:int -pointsEach:double -numMissed:int +FinalExam (questions:int, missed:int) +get Points(): double +getNumMissed(): int The above diagram shows the relationship between GradedActivity and FinalExam classes. The implementation of the set Score () method for the class GradedActivity is given as follows: public class GradedActivity { private double score; public void set Score (double s) { score = s; } } FIGURE Q3 (a) Write class header for FinalExam. (b) Declare data field(s) for FinalExam. (c) Write a constructor with argument(s) for FinalExam. The constructor shall fulfil the following requirements: The constructor accepts two arguments: the number of test questions on the exam, and the number of questions missed by a student. These values are assigned to the numQuestions and numMissed fields. The pointsEach field is assigned with 100.0 divided by numQuestions. Declare a variable called numericScore. Assign the result of the following calculation: 100.0 - (numMissed X pointsEach) to numericScore. Call set Score () method and pass the value of numericScore

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!