Question: JAVA program. Thank you! You will be constructing a series of elecrtonic devices and integrating them in a short program. You will draw heavily from

JAVA program. Thank you!

JAVA program. Thank you! You will be constructing a series of elecrtonic

devices and integrating them in a short program. You will draw heavily

You will be constructing a series of elecrtonic devices and integrating them in a short program. You will draw heavily from our discussions of abstract classes and interfaces. What you need to do You will need to implement the following classes/interfaces, obeying the following (but there may be more you need to do, based on ComputerLand code...): PowerSource (a concrete class), which supports the following: Holds up to 6 ElectronicDevice objects (in an array) An attach() method, per use in ComputerLand Has a printInventory() method that calls getSummary() on all its devices ElectronicDevice (an interface), with the following A getSummary(), as used in PowerSource (see below), returns a String Computer (an abstract class that is a type of ElectronicDevice), with the following: Constructor that takes name (String) and storage (int) as parameters. The storage parameter is just a number, there are no units (like GB or MB). Can be associated with a Printer, as shown in ComputerLand code Must support a save() method that takes an amount of storage needed and decrements the storage available (no filenames required). Has an abatract method called getOperatingSystem() that returns a String Implements getSummary() Printer (an interface that is a type of ElectronicDevice) Supports print() method that takes a jobName (String) and number of pages (int). It returns nothing. Supports a scan() method that takes a jobName, number of pages to scan, and reference to a Computer to save the data to. It returns nothing. AppleMacbook (a concrete type of Computer) Has "OS X" operating system DellDesktop (a concrete type of Computer) Has "Windows" operating system EpsonPrinter (a concrete type of Computer that also can act as a Printer) Every page virtually scanned requires 5 storage units on target computer Logs each virtual scan to output (see below) Logs each page virtually printed (as it is printed) to output (see below) Has "Linux" operating system ComputerLand (included, see below) You must combine your work with the following: public class ComputerLand {public static void main(String[] args) {Computer mac = new AppleMacbook("MyMac", 1000); Computer dell = new DellDesktop("MyDell", 500); Printer epson = new EpsonPrinter("MyEpson", 2); PowerSource source = new PowerSource(); source.attach(mac); source.attach(dell); source.attach(epson); mac.addPrinter(epson); dell.addPrinter(epson); mac.scan("Passport application", 10); mac.print("Story", 5); dell.scan("Taxes", 25); dell.print("License areement", 2); source.printInventory();}} so that the following is produced (exactly) when ComputerLand is run: Scanning 10 pages of Passport application to MyMac Printing page 0 of Story Printing page 1 of Story Printing page 2 of Story Printing page 3 of Story Printing page 4 of Story Scanning 25 pages of Taxes to MyDell Printing page 0 of License areement Printing page 1 of License areement === INVENTORY === MyMac (running OS X) with storage=950 MyDell (running Windows) with storage=375 MyEpson (running Linux) with storage=2

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!