C++代写计算机硬件设备 CS2370 Elecrtonic Devices代做C/C++编程

ImportantDo you own workNo late assignments acceptedOnly turn in .cpp and .h files, no ZIP files or anything else (50% penalty if not)You will be constructing a series of elecrtonic devices and integrating them in a short program.You will draw heavily from our discussions of classes and abstract classes.What you need to doYou will need to implement the following classes, obeying the instructions below (but there may be more you need to do, based on ComputerLand code). Each class must have its own .cpp and .h file.PowerSource (a concrete class), which supports the following:Holds up to 6 ElectronicDevice objects (in an array)An attach() method, per use in ComputerLandHas a printInventory() method that calls getSummary() on all its devicesElectronicDevice (an abstract class), with the followingA pure virtual method called getSummary() that returns a StringComputer (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 codeMust support a save() method that takes an amount of storage needed and decrements the storage available (no filenames required).Provides print() and scan() functions, which leverage the Printer. When scanning, should call local save() (each page requires 5 units of storage)Has an abatract method called getOperatingSystem() that returns a StringImplements getSummary()Printer (an abstract class that is a type of ElectronicDevice)Supports pure virtual method print() method that takes a jobName (String) and number of pages (int). It returns nothing.Supports pure virtual methods scan() method that takes a jobName, number of pages to scan. It returns nothing.AppleMacbook (a concrete type of Computer)Must call superclass constructor. Has “OS X” operating systemDellDesktop (a concrete type of Computer)Must call superclass constructor. Has “Windows” operating systemEpsonPrinter (a concrete type of Computer that also can act as a Printer)Must call superclass constructorLogs each virtual scan to output (see below)Logs each page virtually printed (as it is printed) to output (see below)Has “Linux” operating systemComputerLand (included, see below)You must combine your work with the following ComputerLand.cpp file:12345678910111213141516171819202122int main() Computer* mac = new AppleMacbook(&"MyMac&", 1000); Computer* dell = new DellDesktop(&"MyDell&", 500); EpsonPrinter* 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 applicationPrinting page 5 of StoryPrinting page 5 of StoryPrinting page 5 of StoryPrinting page 5 of StoryPrinting page 5 of StoryScanning 25 pages of TaxesPrinting page 2 of License areementPrinting page 2 of License areement=== INVENTORY ===MyMac, running OS X with storage = 950MyDell, running Windows with storage = 375MyEpson, running Linux with storage = 2转自:http://ass.3daixie.com/2018080860983973.html

你可能感兴趣的:(C++代写计算机硬件设备 CS2370 Elecrtonic Devices代做C/C++编程)