Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions

Question

Graph each function, and give its domain and range. E-XA = (x)

Answered: 1 week ago