Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This assignment allows you to explore inheritance, virtual functions, and operator overloading to model a computer system with various components. You can further extend the
This assignment allows you to explore inheritance, virtual functions, and operator overloading to model a computer system with various components. You can further extend the hierarchy by adding more specific components or functionalities. The framework you develop can be applied to many products consisting of various components. You will be starting up a computer manufacturer and need a system to see that process the orders entered on your website. Each a computer has components such as CPU, Memory, and Storage. A computer may have multiple components of the each type. The system will read an order file which has a customer name and order number on one line, followed by the components of the computer, one per line. As you read the order file, build a set of Computer objects, and store them in a vector. Close the order file and create an invoice file. Print the invoices for all the of the systems and when complete display a summary report. Note: All objects are dynamically allocated and deleted when no longer used. All attributes are private unless specified. Create appropriate Constructors, Destructors, and Accessor methods as needed. Class declarations and implementations must be in the appropriate h and cpp files. STEP : Define a base class called Component with the following attributes and methods:a Attributes: name string serialNumstring price double costdoubleb Methods:i Virtual void infoString: This function should be virtual and returns a string with the basic information about the computer component.ii Void displayInfo: This function displays the components information ie infoString Create three derived classes: CPU, Memory, and Storage, each inheriting from the Component class.a Add common methods and attributes as needed to the base class.b Add specific attributes and methods to derived class as needed.c Each derived class will have its own serial number sequence that should be static in the class.i Serial numbers contain a letter and five digits.d Override the infoString method and others needed for each class Cpu:a Attributes: clockSpeed double in GHz cores int b Serial numbers start at C Memory:a Attributes: size int in GB speed int in MHzb Serial numbers start at M Storage:a Attributes: deviceTypestring capacity intin GB xferSpeeddoublein GBSec lifetime int in s of hours between failure.b Serial numbers start at S Create a class called System that aggregates instances of CPU, Memory, and Storage.a Store the components in a vector called config.b Additional Attributes: serialNumstring totalPrice double totalCostdoublei Serial numbers start a Aii The class will generate a new serial number for each system.c Methods: printInvoice it has a file stream as a parameter and prints a formatted invoiced. Override the displayInfo method to print detailed information about the entire computer.Step :This part will open an orders file that has been entered on your website and built. It contains information about ordered systems. The serial numbers for the components have already been assigned. The serial number for the complete system has not been assigned and will be generated when you read the orders file Create a Class called Order to hold a complete order when read.a Attributes: Order number, custNameb. sysInfo : type System. Has the information for computer system of this order Create a Class called OrderMgr. It will hold the Orders and have various print and support methods.a Attributes: vector of type Order named orders to hold the orders as they are read.b Methods: printInvoices printSummary Open Orders.txt file for input Read in each order, allocate and populate a new computer object for each system Close the order file and create an output file Invoice.txt Have the orderMgr print the invoices to the invoice file. The invoice file has the following format: Rich's Computer Manufacturer INVOICE To: WolverinesOrder Number: Custom system configured as below. Serial #: AItem Serial# Specification PriceCPU C GHz Cores MEMORY MGBMHz STORAGE SGB SSD Xfer:MBs MTBF:hrs Rich's Computer Manufacturer INVOICE To: LionsOrder Number: Custom system configured as below. Serial #: AItem Serial# Specification PriceCPU C GHz Cores MEMORY MGBMHz STORAGE SGB SSD Xfer:MBs MTBF:hrs Have the orderMgr display a summary report with one order per line. a Show the order name, # price, cost, and profit on each line.b Include total line at the bottom. Rich's Computer Manufacturer DAILY ORDER SUMMARY Order # Customer Price Cost Profit Wolverines Lions RedWings Tigers Daily Total: Please utilize any files provided as a starting point for your development. Submit the follow for the assignment: The UML diagrams for your system A screen capture showing the file panel of Visual Studio Run yorogram with the final order file provided A copy of the screen capture of the output displayed A listing of Invoices.txt file Properly commented and formatted source code Hints are bM organization could beOrders.txt:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started