Question: please use Java Store # name: String/example: James Electronics # address: String example: Beirut/Hamra # devices: ArrayList + toString(): String Device #name: String # price:

 please use Java Store # name: String/example: James Electronics # address:

String example: Beirut/Hamra # devices: ArrayList + toString(): String Device #name: String

please use Java

Store # name: String/example: James Electronics # address: String example: Beirut/Hamra # devices: ArrayList + toString(): String Device #name: String # price: doube #voltage: double #amp: double + Device (all arguments) + toString(): String + getters & Setters + power(): double AC - frequency: int + AC (all arguments) + toString(): String DC -battery Arrangement int / for serial, 1 for parallel - batteryCount: int +DC (all arguments) + toString(): String Question 1 [10 points]: Continue the implementation of the class DC. Override the method power, it returns the power consumption as follows: o voltage * batteryCount * amp; Question 2 [26 points]: Implement the class Store. The attributes of this class corresponds to: name: representing the name of the store. - address: representing the address of the store. devices: an ArrayList of device objects The public methods of the class are: : a. Constructor to initialize an object have name and address, moreover it must initialize an empty ArrayList of devices. b. addDevice(d: Device) method adds the device d' to the ArrayList. c. getDevices(): returns an ArrayList of devices. Question 3 (14 points): Continue the implementation of the class Store. Implement the method toString. It returns information about all the devices in the ArrayList devices. The below example displays information about three devices in a store. The store name is James Electronics and it is located at Beirut/Hamra The store has the below devices: AC Device: Frequency = 50Hz Name: 40' TV Price $: 200 Voltage: 220 Amp: 0.5 Power: 120W DC Device: Name: Torch Price $: 5 Voltage: 9 Amp: 2 The device has number of batteries= 1 and they are arranged in serial Power consumption is 18W AC Device: Frequency = 60Hz Name: Hoover Price $: 300 Voltage: 110 Amp: 10 Power: 1100W

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!