Question: java programing Program 1 Earlier we discussed a Computer class with a Notebook class as its only subclass. However, there are many different kinds of

java programing

Program 1

Earlier we discussed a Computer class with a Notebook class as its only subclass. However, there are many different kinds of computers. An organization may have servers, mainframes, desktop PCs, and notebooks. There are also personal data assistants and game computers. So it may be more appropriate to declare class Computer as an abstract class that has an actual subclass for each category of computer. It is required to:

a) Write an abstract class Computer that defines all the methods shown earlier and declares an abstract method with the signature double costBenefit () that returns the cost-benefit (type double) for each category of computer.

b) Write a game computer class as a sub class of Abstract Computer class. Make sure to implement any abstract methods and add any necessary data fields.

c) Write a server class as a sub class of Abstract Computer class. Make sure to implement any abstract methods and add any necessary data fields.

d) Test your code by creating a main method that creates a game computer object and server object and print all the information of each one of them in addition to the computed cost-benefit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!