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 Graded Activity -score: double setScore(s: double): void getScore(): double +getGrade(): char PassFailActivity -minPassingScore: double + PassFailActivity(mps: double) +getGrade(): char 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) PassFail Exam -numQuestions: int -pointsEach: double -numMissed: int + PassFail Exam(questions: int, missed: int, minPassing: double) getPoints Each(): double + getNumMissed(): int

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Please help me with part A and B using java. Please use comments that explain each line of code
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
Score
90
80 70
The getGrade() - works on the table given below.
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.
Graded Activity
-score: double
+ setScore(s: double): void
+ getScore(): double
+ getGrade(): char
PassFailActivity
-min PassingScore: double
+ PassFailActivity (mps: double)
+ getGrade(): char
PassFailExam
-numQuestions: int
-points Each: double
-numMissed: int
+ PassFail Exam(questions: int,
missed: int,
minPassing: double)
+getPoints Each(): double
+ getNumMissed(): int
pointsEach = 100.0 / questions;
numericScore = 100.0 - (missed * points Each)
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)
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 Score 90 80 70 The getGrade() - works on the table given below. 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. Graded Activity -score: double + setScore(s: double): void + getScore(): double + getGrade(): char PassFailActivity -min PassingScore: double + PassFailActivity (mps: double) + getGrade(): char PassFailExam -numQuestions: int -points Each: double -numMissed: int + PassFail Exam(questions: int, missed: int, minPassing: double) +getPoints Each(): double + getNumMissed(): int pointsEach = 100.0 / questions; numericScore = 100.0 - (missed * points Each) 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)
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY