Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ANSWER ASAP LIKE WILL BE PROMISELY GIVEN NEEDED IN JAVA PLEASE WRITE NEW AND FRESH CODE OTHERWISE DISLIKE WILL BE GIVEN. DON'T REUSE CODE

PLEASE ANSWER ASAP LIKE WILL BE PROMISELY GIVEN

NEEDED IN JAVA

PLEASE WRITE NEW AND FRESH CODE OTHERWISE DISLIKE WILL BE GIVEN. DON'T REUSE CODE OR PARAPHRASE CODE OTHERWISE DISLIKE WILL BE GIVEN. PLEASE WRITE YOUR OWN CODE.

PLEASE COMMENT ON THE CODE.

image text in transcribed

We have to calculate the percentage of marks obtained in: two subjects (each out of 100) by student A. three subjects (each out of 100) by student B. and three subjects (each out of 100) by student C. Create an abstract class 'Marks' with an abstract method 'myPercentage'. It is inherited by three other classes 'A', 'B' and 'C' each having a method with the same name 'myPercentage'; which returns the percentage of the students. The constructor of: student A takes the marks in two subjects as its parameters And the marks in three subjects as its parameters for student B and C. Create an object for each of the three classes and print the percentage of marks for all the students. Output Example: Student A is taking 2 subjects: his percentage = 90% Student B is taking 3 subjects: his percentage = 95% Student C is taking 3 subjects: his percentage = 85%

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions