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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started