Answered step by step
Verified Expert Solution
Link Copied!

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 1:1. Define a base class called Component with the following attributes and methods:a. Attributes: name (string), serialNum(string), price (double), cost(double)b. 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 (i.e. infoString)2. 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 class3. Cpu:a. Attributes: clockSpeed (double) in GHz, cores (int). b. Serial numbers start at C50001.4. Memory:a. Attributes: size (int)- in GB, speed (int) in MHzb. Serial numbers start at M60001.5. Storage:a. Attributes: deviceType(string) capacity (int)-in GB, xferSpeed(double)-in GB/Sec, lifetime (int)- in 1000s of hours between failure.b. Serial numbers start at S70001.6. 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: serialNum(string), totalPrice (double), totalCost(double)i. Serial numbers start a A10001.ii. 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 2: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.1. 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.2. 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()3. Open Orders.txt file for input.4. Read in each order, allocate and populate a new computer object for each system.5. Close the order file and create an output file Invoice.txt.6. 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: 12578 Custom system configured as below. Serial #: A00001----------------------------------------------------------------------Item Serial# Specification PriceCPU C500212.70 GHz,4 Cores 199.00MEMORY M6007832GB,2400MHz 89.00STORAGE S70231960GB SSD, Xfer:3.20MB/s, MTBF:4200hrs 120.00==========408.00 Rich's Computer Manufacturer -- INVOICE --To: LionsOrder Number: 12580 Custom system configured as below. Serial #: A00002----------------------------------------------------------------------Item Serial# Specification PriceCPU C501232.10 GHz,1 Cores 239.00MEMORY M6231164GB,3200MHz 125.25STORAGE S70165986GB SSD, Xfer:12.00MB/s, MTBF:8600hrs 159.99==========524.24......7. 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------------------------------------------------------------------12578 Wolverines 408.00217.25190.7512580 Lions 524.24254.50269.7413006 Red_Wings 582.97256.10326.8714378 Tigers 785.95398.95387.00------------------------------------------------------------------ Daily Total: 2301.161126.801174.36 Please utilize any files provided as a starting point for your development. Submit the follow for the assignment:1. The UML diagrams for your system.2. A screen capture showing the file panel of Visual Studio3. Run yorogram with the final order file provided.4. A copy of the screen capture of the output displayed.5. A listing of Invoices.txt file6. Properly commented and formatted source code Hints are bM organization could beOrders.txt:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Finance The Role Of Data Analytics In Manda Due Diligence

Authors: Ps Publishing

1st Edition

B0CR6SKTQG, 979-8873324675

More Books

Students also viewed these Databases questions