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
Select the examples that best demonstrate likely tasks for Revenue and Taxation workers. Check all that apply. Brenda works for
umka2103 [35]

Answer:

Brenda works for the IRS reviewing paperwork.

Jenny reviews buildings to determine how much money they are worth

Kareem advises businesses to make sure they handle their finances correctly.

Explanation:

5 0
2 years ago
Read 2 more answers
The pseudoinstructions that are available in an assembly language programming environment usually found in the Select one: a. CP
mafiozo [28]

Answer:

b

Explanation:

CPU manual provides guides to use a CPU.

Assembler manual provides guide on how to use an assembler and so is the case for compiler.

For a particular machine, it set of instructinos are available with the programmer.

6 0
2 years ago
What is the law of the XNOR logic gate?
miskamm [114]

logic gate (AND, OR, XOR, NOT, NAND, NOR and XNOR) A logic gate is an elementary building block of a digital circuit. Most logic gates have two inputs and one output. At any given moment, every terminal is in one of the two binary conditions low (0) or high (1), represented by different voltage levels.Mar 6, 2018




Read more on Brainly.com - brainly.com/question/11896675#readmore

6 0
3 years ago
Name the six parts of the product development life cycle.
Nuetrik [128]

Answer:

Development, Introduction, Growth, Maturity and Decline.

Explanation:

5 0
3 years ago
Read 2 more answers
Which of the following are vector graphic file formats? Choose all that apply.
blondinia [14]

There are different kinds of files. The option that is a vector graphic file formats is SVG.

<h3>What are vector files?</h3>

Vector files are known to be a type of images that are created by using mathematical formulas that stands as points on a grid.

The SVG  is known as Scalable Vector Graphics file and it is known to be a  vector image file format as it make use of geometric forms such as points, lines, etc.

Learn more about vector graphic file from

brainly.com/question/26960102

3 0
2 years ago
Other questions:
  • Harry needs to use a type of graph in a spreadsheet to show variations in data over a specific period. What type of graph or cha
    11·2 answers
  • A network ____ usually contains a computer, networked peripheral, or network device.
    14·1 answer
  • In fiberoptic cable, the signal source is__________waves
    7·1 answer
  • The United States is the only country in the world in which organs and tissue transplants are performed. True or False?
    8·1 answer
  • Which of the following statements best deceive the relationship between carrying capacity and population size
    12·1 answer
  • Which DHCPv4 message will a client send to accept an IPv4 address that is offered by a DHCP server? (Points : 5) Unicast DHCPACK
    8·1 answer
  • [1] Please find all the candidate keys and the primary key (or composite primary key) Candidate Key: _______________________ Pri
    6·1 answer
  • Will give brainliest!<br> Who created binary, and does anyone have any idea how?
    13·1 answer
  • PLEASE HELP!!<br> Would you ever try and get famous off of social media? Why or why not?
    6·2 answers
  • The Baltimore Sun reported on a study by Dr. Sara Harkness in which she compared the sleep patterns of 6-month-old infants in th
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!