Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answer any questions after posting code that runs correct output shown, for thumbs up please. Task 5. Creating inheritance 2 (20 points) - Purpose: Use
Answer any questions after posting code that runs correct output shown, for thumbs up please.
Task 5. Creating inheritance 2 (20 points) - Purpose: Use inheritance to manage the definition of common/individual properties and methods Task: Given class GradedActivity: public class GradedActivity { private double score; // Numeric score public void setScore (double s) { score = S; } public double getScore() { return score; } public char getGrade() { char letterGrade; if (score >= 90) letterGrade = 'A'; else if (score >= 80) letterGrade = 'B', else if (score >= 70) letterGrade = 'C'; else if (score >= 60) letterGrade = 'D'; else letterGrade = 'F'; return letterGrade; } 1. Design a FinalExam class that extends the GradedActivity class. The FinalExam class should determine the grade a student receives for an exam. The student's exam score can be up to 100 and is determined in the following manner: MultipleChoice: 50 points FillinTheBlank: 20 points Coding: 30 points You are not allowed to modify the GradedActivity class, except to make it static if you want to include it in the same.java file as the main program. 2. Demonstrate the class in a simple program that assigns scores for each of the 3 sections and displays the resulting letter grade. One possible main program, although this can be done several other ways: FinalExam f = new FinalExam(); f.setScore(45, 10, 25); System.out.println("The student earned a + f.getGrade()); With the output The student earned a B - Rubric: Student name and today's date is a comment in the first line of the programs: -10 points if fails Screenshot and program code: -10 points if fails FinalExam class matches problem statement (MultipleChoice, FillInTheBlank, Coding): - 20 points if fails GradedActivity included as-is: 7 points FinalExam inheritance and method override(s): 7 points FinalExam data structures as/if needed: 3 points - Main program to demonstrate FinalExam: 3 points Please paste a screenshot of a successful program run, and copy-and-paste the source code from your main program's java file, hereStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started