Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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; }}image text in transcribed@override

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) + toString(): String + //getters & Setters methods + isAlternative(o: Object): boolean Laptop cpu: String type: String + Laptop (all arguments) + toString(): String + getCpuo:String + getType():String Usb storage: int + Usb (all arguments) + toString(): String

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago

Question

1. Traditional and modern methods of preserving food Articles ?

Answered: 1 week ago

Question

What is sociology and its nature ?

Answered: 1 week ago

Question

What is liquidation ?

Answered: 1 week ago