PART A The following UML diagram indicates the different classes and the inheritance structure used. Using this as a guide develop a program that demonstrates the working of this UML Diagram. 1) The Graded Activity Class The getGrade() - works on the table given below. Score 90 80 70 60 <60 Grade A B C D F 2) PassFailActivity Class - This class holds a numeric score and determines whether the score is passing or failing. The getGrade() method returns a letter grade determined from the score field. This method overrides the superclass method. 3) PassFailExam Class - This class determines a passing or failing grade for an exam. The constructor sets the number of questions, the number of questions missed, and the minimum passing score. Calculate the points for each question and the numeric score for this exam. pointsEach = 100.0 / questions; numericScore = 100.0 - (missed* points Each) Graded Activity -score: double + setScore(s: double): void +getScore(): double + getGrade(): char PassFailActivity -minPassingScore: double + PassFailActivity(mps: double) +getGrade(): char PassFail Exam -numQuestions: int -pointsEach: double -numMissed: int + PassFail Exam(questions:int, missed:int, minpassing: double) +getPoints Each(): double + getNumMissed(): int The main class should consists of objects to test the various methods in the classes given. PART B Add 2 additional methods to the PassFailExam class - public boolean equals(GradedActivity g)

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 12SA: Assume the definition of class houseType as given in Exercise 11. Answer the following questions....
icon
Related questions
Question
Please help me with this using java. Please use comments explaining each line of code. Please complete both part A and B
PART A
The following UML diagram indicates the different classes and the inheritance structure used. Using
this as a guide develop a program that demonstrates the working of this UML Diagram.
1) The Graded Activity Class
The getGrade() - works on the table given below.
Score
90
80
70
60
<60
Grade
A
B
C
D
F
GradedActivity
-score: double
+ setScore(s: double): void
+ getScore(): double
+ getGrade(): char
A
PassFailActivity
-minPassingScore: double
+ PassFailActivity (mps: double)
+ getGrade(): char
4
2) PassFailActivity Class - This class holds a numeric score and
determines whether the score is passing or failing.
The getGrade() method returns a letter grade determined from
the score field. This method overrides the superclass method.
3) PassFailExam Class - This class determines a passing or failing
grade for an exam.
The constructor sets the number of questions, the number of
questions missed, and the minimum passing score.
Calculate the points for each question and the numeric score for
this exam.
pointsEach 100.0 / questions;
numericScore = 100.0 - (missed* pointsEach)
The main class should consists of objects to test the various methods in the classes given.
PART B
Add 2 additional methods to the PassFailExam class
public boolean equals(GradedActivity g)
PassFailExam
-numQuestions: int
-points Each: double
-numMissed: int
+ PassFail Exam(questions: int,
missed: int,
minPassing: double)
+ getPointsEach(): double
+getNumMissed(): int
public boolean greater (Graded Activity g)
Using two objects of the PassFailExam class compare whether the exam scores are equal or greater
display t
Transcribed Image Text:PART A The following UML diagram indicates the different classes and the inheritance structure used. Using this as a guide develop a program that demonstrates the working of this UML Diagram. 1) The Graded Activity Class The getGrade() - works on the table given below. Score 90 80 70 60 <60 Grade A B C D F GradedActivity -score: double + setScore(s: double): void + getScore(): double + getGrade(): char A PassFailActivity -minPassingScore: double + PassFailActivity (mps: double) + getGrade(): char 4 2) PassFailActivity Class - This class holds a numeric score and determines whether the score is passing or failing. The getGrade() method returns a letter grade determined from the score field. This method overrides the superclass method. 3) PassFailExam Class - This class determines a passing or failing grade for an exam. The constructor sets the number of questions, the number of questions missed, and the minimum passing score. Calculate the points for each question and the numeric score for this exam. pointsEach 100.0 / questions; numericScore = 100.0 - (missed* pointsEach) The main class should consists of objects to test the various methods in the classes given. PART B Add 2 additional methods to the PassFailExam class public boolean equals(GradedActivity g) PassFailExam -numQuestions: int -points Each: double -numMissed: int + PassFail Exam(questions: int, missed: int, minPassing: double) + getPointsEach(): double +getNumMissed(): int public boolean greater (Graded Activity g) Using two objects of the PassFailExam class compare whether the exam scores are equal or greater display t
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT