Question: Question 1 Implement the below interface and classes except the class NetworkDevice which you can assume its code exists when you need to call it

Question 1 Implement the below interface and classes except the class NetworkDevice which you can assume its code exists when you need to call it : DataCenter - name: String - nbDevices : int - devices: Device[] +DataCenter (name: String, maxNbDevices:int) +getDevices():Device[] +addDevice(d : Device) : boolean +displayServers():void +toString():String NetworkDevice -nbOfPorts: int -powerOverEthernet: boolean +NetworkDevice(all arguments) +toString(): String //getters and setters A. Device Class (An Abstract Class) - The toString method returns a String of the form Id:,Brand: . . B. Server Class - It has two private attributes: o operatingSystemType: the type of the installed operating system (ex: Linux Windows, etc) o availableServices: it is a string that contains all the installed services. It is of the following form : Service1:Service2:Service3. Example: DHCP:DNS:MailService:WebService > Similar +isSimilar(o:Object):boolean Device #id: int #brand: String +Device(all arguments) +toString():String Server -operatingSystemType: String -availableServices: String +Server (all arguments) +toString(): String +addAService(service:String): boolean +findAServie(service:String): boolean //getters and setters - The method addAService takes the name of the new service and adds it at the end of the string availableServices, if it does not already exist. It returns false if the service is already installed, and true otherwise. - The method findAService takes the name of a service and returns true if it is installed on this server, and false otherwise. - The method isSimilar should be implemented in this class. It is used to compare two servers. Two servers are similar if they have the same brand, same operating system type and same installed services. - The toString method returns a string with the following format: Server: Id:123, Brand: Lenove, OperatingSystem: Windows, Services : DHCP, DNS, Mail

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!