(Implementing inheritance and apply the use of keyword super and this) Assume you have to develop a grading application for grading student's activity. Each activity will be given a numeric score (0 to 100), and accordingly will be given a grade (A, B, C, D, or F). The grade is given based on the condition in Table 1 below. Table 1: Scores and their corresponding grades Condition Letter Grade Score >= 90 A Score >= 80 B Score >= 70 C Score 60 Score < 60 D F Create a class name Graded Activity, with an attribute to hold the score for the activity. The SetScore method sets the score from a given parameter value and the getScore method returns the score. A getGrade method should return a grade's letter based on the given numeric score, according to the rules given in Table 1. Then create a new class Essay which extends the Graded Activity class. The new class is to determine the grade a student receives for an essay based on the accumulated score (0 to 100), which is accumulated based on a list of score's distributions, as follows: Grammar: 0 to 30 Spelling: 0 to 20 Correct length: 0 to 20 Content: 0 to 30 For example, if a student receives score 30 for Grammar, 20 for Spelling, 12 for Correct length and 10 for Content, the total score is 30+20+12+10=72 and thus given C as grade. Use the keyword super to update the attribute of the superclass. Use the keyword this to refer to the current class' attributes and methods. Implement the Java program to demonstrate the application of both classes.

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
(Implementing inheritance and apply the use of keyword super and this)
Assume you have to develop a grading application for grading student's activity. Each
activity will be given a numeric score (0 to 100), and accordingly will be given a grade (A,
B, C, D, or F). The grade is given based on the condition in Table 1 below.
Table 1: Scores and their corresponding grades
Condition
Letter Grade
Score>= 90
A
Score>= 80
Score>= 70
C
Score >= 60
D
Score < 60
Create a class name GradedActivity, with an attribute to hold the score for the activity.
The SetScore method sets the score from a given parameter value and the getScore method
returns the score. A getGrade method should return a grade's letter based on the given
numeric score, according to the rules given in Table 1.
Then create a new class Essay which extends the GradedActivity class. The new class is
to determine the grade a student receives for an essay based on the accumulated score (0 to
100), which is accumulated based on a list of score's distributions, as follows:
Grammar: 0 to 30
Spelling: 0 to 20
Correct length: 0 to 20
Content: 0 to 30
For example, if a student receives score 30 for Grammar, 20 for Spelling, 12 for Correct
length and 10 for Content, the total score is 30+20+12+10=72 and thus given C as grade.
Use the keyword super to update the attribute of the superclass. Use the keyword this to
refer to the current class' attributes and methods.
Implement the Java program to demonstrate the application of both classes.
Transcribed Image Text:(Implementing inheritance and apply the use of keyword super and this) Assume you have to develop a grading application for grading student's activity. Each activity will be given a numeric score (0 to 100), and accordingly will be given a grade (A, B, C, D, or F). The grade is given based on the condition in Table 1 below. Table 1: Scores and their corresponding grades Condition Letter Grade Score>= 90 A Score>= 80 Score>= 70 C Score >= 60 D Score < 60 Create a class name GradedActivity, with an attribute to hold the score for the activity. The SetScore method sets the score from a given parameter value and the getScore method returns the score. A getGrade method should return a grade's letter based on the given numeric score, according to the rules given in Table 1. Then create a new class Essay which extends the GradedActivity class. The new class is to determine the grade a student receives for an essay based on the accumulated score (0 to 100), which is accumulated based on a list of score's distributions, as follows: Grammar: 0 to 30 Spelling: 0 to 20 Correct length: 0 to 20 Content: 0 to 30 For example, if a student receives score 30 for Grammar, 20 for Spelling, 12 for Correct length and 10 for Content, the total score is 30+20+12+10=72 and thus given C as grade. Use the keyword super to update the attribute of the superclass. Use the keyword this to refer to the current class' attributes and methods. Implement the Java program to demonstrate the application of both classes.
Expert Solution
steps

Step by step

Solved in 4 steps with 4 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