Question
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
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 isAlternative. 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 (corei5, 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 + " GB " ; } @Override public boolean isAlternative(Object o) { return true; }}@override
Consider the TechShop, Device, Laptop and Usb classes described in the following UML: TechShop name: String - devices: ArrayListStep 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