Question: i am in a hurry please help me Consider the TechShop, Device, Laptop and Usb classes described in the following UML: TechShop -name: String -

i am in a hurry please help me Consider the TechShop, Device,Laptop and Usb classes described in the following UML: TechShop -name: Stringi am in a hurry please help me

Consider the TechShop, Device, Laptop and Usb classes described in the following UML: TechShop -name: String - devices: ArrayList #price: double + toString(): String + Device (all arguments) + toString(): String + //getters & Setters methods + is Alternativelo: Object): boolean Usb Laptop -cpu: String storage: int type: String + Laptop (all arguments) + Usb (all arguments) +toString(): String + toString(): String + getCpu() String + getType():String Question 1: (15 Points) Implement the class Device. In this question, you are required to declare all the attributes and methods (the constructor, the getters/setter methods...) as presented in the UML diagram. a. The class is abstract and contains an abstract method named is Alternative. b. The method toString method returns a String of the form "Brand: - Price: .. dollars". Question 2 [15 points]: Implement the class Laptop. It has two private attributes. The cpu (coreis, corei7...) and the type that indicates whether the Laptop is ultrabook, notebook, etc. a. Implement the constructor and the getter/setter methods b. The toString method returns a String of the form: Laptop Brand: .. Price ... dollars. Cpu: ... And Type:.. Question 3 Do Not Implement class Usb. The code is public class Usb extends Device { private int storage; public Usb (String brand, double price, int s) { super (brand, price); this.storage - s; } @Override public String toString() { return "Usb " + super.toString() + " Storage is" + storage + } @Override public boolean isAlternative (Object of return true; } 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!