Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Dear All, would you please help me with the below assignment using C++ : Project #5 Store CISP 400 C++ Programming Inheritance Using the last

Dear All,

would you please help me with the below assignment using C++ :

Project #5 Store

CISP 400 C++ Programming

Inheritance

Using the last assignment, create a class Store that will track inventory.

This class will contain a private fixed-size array of pointers to Inventory items from the last project.

It will have only three public member functions:

1. A default constructor that will create an empty Store.

2. A destructor. The destructor will clean up

3. A member function void Run(); This will start the inventory control program and display a menu through which the user may interact with the object. The menu should offer the following choices

1. Enter a new item into inventory

2. Display the inventory.

3. Display the total quantity of inventory items.

4. Display the totals: total gross profits.

5. Quit.

4. NO MORE! Only three!

----------------------------------------------------------------------------------------------------------------------------------

The last assignment was:

Project #4 Inventory

CISP 400 Programming Project #4

Inheritance

For this assignment we will start with a base class that I have provided: Inventory[1].

This is an abstract base class. You will publicly inherit:

Inventory

o Hardware

Fastener

Hinge

o Lumber

Hardwood

Softwood

o Pipe I will provide these as examples

Plastic

For every data member of every class provide set and get functions

Class Hardware will have a private data member of _material_type, an enumerated type Material_Type {MTunknown, Stainless, Steel, Copper, Bronze}.

Class Lumber will have a private data member of _surfacing_type, an enumerated type Surfacing_Type {STunknown, Rough, S2S, S4S}.

Class Fastener will have a private data member _fastener_type, an enumerated type Fastener_Type {FTunknown, Nails, Screw, Bolt}; a private data member _profit_margin that will be a percentage stored as a float: Nails 5%, Screws 7.5%, Bolts 10%; a private data member _pieces which will store the number in Inventory.

Class Hinge will have a private data member _hinge_type, an enumerated type Hinge_Type {HTunknown, Butt, Overlay, Offset} a private data member _pieceswhich will store the number in Inventory. All hinges will have a profit margin of 12.5%.

Class Hardwood will have a private data member _wood_type, an enumerated type Wood_Type { WTunknown, Oak, Maple, Birch}; a private data member _board_feet which will store the number of board feet in this lot of Inventory. Profit margins are: Oak 15%, Maple 18%, Birch 12.5%.

Class Softwood will have a private data member _thickness, an unsigned; _units an unsigned that tracks the number of units in stock; profit margin: 5% plus .1% for every of thickness. For example the profit margin for thick lumber is 5% + 3 * .1% = 5.3%. Lumber that is 1.5 thick would be 5% + 6 * .1% = 5.6%. All Softwood has a SurfacingType of S4S.

All of these enumerated types will be declared in the public part of the class. See Pipe and Plastic for examples of this. Common attributes should be collected into common base classes we will talk about this in class.

[1] Real UPC codes are exactly 12 numeric characters. 12! Do we feel like typing 12 characters every time we want to test our code? No! So, I have shortened the length to 3. I have used a const: change it to 12 and it is real-world correct. But, the const is in my implementation file, so you do not have access to it. L

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions