Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the java code of the interface IComputer that contains the followings: B/ The property IPAdress (number) with get and set assessors. The method
Write the java code of the interface IComputer that contains the followings: B/ The property IPAdress (number) with get and set assessors. The method Cost() that returns the total cost of a computer (PriceComputer + Tax). Tax-5%. Write the java code of the abstract class Computer that contains the followings: 4 protected attributes: o Nunc, integer o SpeedCPU, number o Ram, number o PriceComputer, double A constructor that initializes the attributes of the class. A public property (with both set and get accessors) called Price, which is used to initialize the PriceComputer. Check if the Price is positive (>0). A virtual method PrintInfo() that prints the values of the attributes of the class. Write the java code of the class Server that inherits the base class Computer and implements the interface IComputer, and contains the followings: D/ A private attribute ipadress (number) Constructor that initializes all the attributes of the class. Override the method PrintInfo() that displays the values of the attributes of the class. Override and implement all the inherited methods and properties (form the inherited class and the implemented class). In the main method: Create an object of the class Computer; Create an array Cmp of type Server and size 2; Create 2 objects of Server: Store these objects in the array Cmp; Print the information of the stored objects in the array Cmp:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres the Java code that satisfies the requirements mentioned Interface Computer interface Computer void setIPAddressint ipAddress int getIPAddress do...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