Question: write An object named UseElectronics with A method named useAll that takes a List of Electronics as a parameter and returns Unit Calls the use
write An object named UseElectronics with A method named "useAll" that takes a List of Electronics as a parameter and returns Unit Calls the "use" method on all the Electronics in the input list [Notice that the specic method that is called depends on whether the Electronic is a BoomBox or a FlashLight] A method named "swapBatteries" that takes two Electronics as parameters and returns Unit Exchanges the batteries between the two Electronics
Testing: In a package named "tests" create a Scala class named "TestElectronics" as a test suite that tests all the functionality listed above
Language: Scala
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
