Question: Please use Java programming Consider the TechShop, Device, Laptop and Usb classes described in the following UML: TechShop - name: String - devices: ArrayList +

 Please use Java programming Consider the TechShop, Device, Laptop and Usb

classes described in the following UML: TechShop - name: String - devices:Please use Java programming

Consider the TechShop, Device, Laptop and Usb classes described in the following UML: TechShop - name: String - devices: ArrayList + TechShop (name: String) + addDevice(d: device): void + getDevices(type: int): ArrayList + toString(: String Device #brand: String #price: double + Device (all arguments) + toString0 : String +//getters & Setters methods + is Alternative(o: Object): boolean Laptop - cpu: String type: String + Laptop (all arguments) + toString(): String + getCpu():String + getType():String Usb storage: int + Usb (all arguments) + toString(): String Part II Question 1: (10 Points) Continue the implementation of the class Laptop a. Implement the isAlternative method of signature public boolean isAlternative (Object o). Two Laptops are alternatives if they have the same type and the same cpu. Question 2: (26 Points) Implement the class TechShop. a. Constructor: set the name of the TechShop, and initializes the ArrayList for devices. b. addDevice (device: Device) : This method adds a Device to devices ArrayList. c. getDevices(): This method returns the list of devices. Question 3: (14 Points) Continue the implementation of the class TechShop. Implement the toString method. It returns information about all the devices in the ArrayList devices. TechShop Name: Modern Technology Devices: Laptop Brand: HP Price: 500 dollars. Cpu: corei7 And Type:Ultrabook Laptop Brand: Lenovo Price 600 dollars. Cpu: corei5 And Type: Notebook Usb Brand: SanDisk Price: 30 dollars. Storage is 32 GB

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!