Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class that can be used for a Personal Computer. The class should have attributes for the: -Manufacturer (e.g. Dell, Gateway, etc.), -Form Factor

“Create a class that can be used for a Personal Computer. The class should have attributes for the:

-Manufacturer (e.g. Dell, Gateway, etc.),

-Form Factor (laptop/desktop),

-Serial Number

-Processor ( I3, I5, I7, AMD Ryzen 3, AMD Ryzen 5, etc.),

-RAM (4, 6, 8, 16, 32, or 64GB),

-Storage Type (UFS, SDD, HDD) and

-Storage Size (128GB, 256GB, 512GB, 1TB, 2TB).

The constructor must accept the manufacturer, form factor, serial number, processor, RAM, storage type/size.

Create accessor methods that allow these attributes to be retrieved individually.

Create mutator methods that allow the RAM and the storage drive (type and size) to be changed.

Incorporate exception handling to reject invalid values in the constructor and mutator methods.

Create a toString() method formulate a string containing the manufacturer, form factor, serial number, processor, RAM, and storage type/size.

Write a main program that creates a vector that can contain personal computers. The program should prompt the user for an indeterminate number of personal computers, create a personal computer object, and add the object.

The program should check for a pre-existing “computer inventory” file and, if there is one, populate the collection (vector) of the inventory with the contents of the file.

The program should then provide the user with a menu allowing them to

-add a new computer to the inventory,

-delete a computer from the inventory,

-list all the computers in the inventory

-exit.

When exiting the menu (before exiting the program), the code should open a file and record all of the existing inventory in the file. This file will be used (in item 1 above) to prepopulate the inventory with existing entries the next time the program is run.


Step by Step Solution

3.43 Rating (150 Votes )

There are 3 Steps involved in it

Step: 1

Program personalcomputerh include include using namespace std Create personal computer with attributes of manufactureform factorserial numberprocessorRAMstorage type and size Appropriate constructorac... 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

Step: 3

blur-text-image

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

Accounting Information Systems

Authors: Marshall B. Romney, Paul J. Steinbart

13th edition

133428532, 978-0133428537

More Books

Students also viewed these Operating System questions

Question

=+a) Is this an experiment or an observational study? Explain.

Answered: 1 week ago