1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Novosadov [1.4K]
3 years ago
11

We have to calculate the percentage of marks obtained in three subjects (each out of 100) by student A and in four subjects (eac

h out of 100) by student B. Create an abstract class 'Marks' with an abstract method 'getPercentage'. It is inherited by two other classes 'A' and 'B' each having a method with the same name which returns the percentage of the students. The constructor of student A takes the marks in three subjects as its parameters and the marks in four subjects as its parameters for student B. Create an object for eac of the two classes and print the percentage of marks for both the students.
Computers and Technology
1 answer:
MAXImum [283]3 years ago
6 0

Answer:

abstract class Mark  //Creating an Abstract class{

abstract double getPercentage();}

class A extends Mark{

double result;

A( int val1, int val2, int val3){

 result=(val1+val2+val3)/3;}

double getPercentage(){

 return result;}}

class B extends Mark{

double result;

B(int val1, int val2, int val3, int val4){

 result=(val1+val2+val3+val4)/4;}

double getPercentage(){

 return result;}}

class Main{

public static void main(String args[]){

 //class A Object

 Mark obj_1=new A(10,20,30);

 System.out.println(obj_1.getPercentage());

 //class B Object

 Mark obj_2=new B(10,20,38,46);

 System.out.println(obj_2.getPercentage());}}

You might be interested in
If all of Earth's history were squeezed into one 12-hour period, how long ago did Precambrian time end? How long did the Cenozoi
Jet001 [13]

Answer:

That it

Explanation:

There have been mass extinctions during the Cenozoic as there were during the Mesozoic and Paleozoic, but not as many animals and plants have disappeared. Finally, humanity appeared during the last two million years.The human lineage only diverged from our most recent common ancestor about 5 million years ago; less than half of 1% of that time, and modern Homo sapiens is only between 200,000 and 50,000 years old, depending on your definition.

7 0
3 years ago
Jason needs to design the colors for a web site that make it easy to read. Which should he consider using?
ololo11 [35]

Answer: Dark background and light text.

Explanation:

Assuming when you mean by "light text", you mean by white text. This should be able to be readable by users visiting the site.

4 0
3 years ago
Another one please help quick i got to go soon
astraxan [27]

Answer:

no

Explanation:

yellow: the last sentence in the text

blue: Queenies flowers reached for the sky

Personification means that you apply human characteristics to things that are not alive, like a flower smiling, a term used when people see a field of healthy flowers

7 0
3 years ago
Who is the CEO of Epic Games?​
slavikrds [6]

Answer:

it's tim sweeney....

Explanation:

hope it helps

4 0
3 years ago
Read 2 more answers
If a menu item requires additional information from the user, the Windows standard is to place a(n) ____ at the end of the capti
elena-s [515]

Answer:

elipses

Explanation:

According to my research on information technology, I can say that based on the information provided within the question the windows standard in this situation would be to place an ellipses at the end of the caption. This is because in the English language an ellipses (...)  usually indicates an intentional omission of a word or sentence, which in computer science is used to give the user an indication that it requires further user input.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

4 0
3 years ago
Other questions:
  • At an open or uncontrolled intersection, yield if ____.
    15·2 answers
  • What was one of the first inventions that made it possible to communicate almost instantly?
    11·1 answer
  • Jenny is the project manager and her company. She needs to break her current project into parts that her employees can work on.
    10·1 answer
  • What characters cannot be used in a filename?
    15·1 answer
  • Create a Python program that: Allows the user to enter a person's first name and last name. The user should be able to enter as
    12·1 answer
  • "What technology will examine the current state of a network device before allowing it can to connect to the network and force a
    6·1 answer
  • Identify and explain 3 methods of automatically formatting documents​
    8·1 answer
  • How do we produce quality work in editing audio?
    7·1 answer
  • Help help help help help help help help
    12·1 answer
  • What does playstation network is currently undergoing maintenance?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!