Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ PROGRAM: Write a windows console application that holds data about an item in a retail store. Your class should be named RetailItem and should

C++ PROGRAM:

Write a windows console application that holds data about an item in a retail store.

Your class should be named RetailItem and should hold data about an item in a retail store. The class will have the following member variables.

descriptionstring holding the description of the item

unitsOnHandint that holds the number of units in inventory

pricedouble that holds the price of the item

You will need two constructors, one that will accept arguments for each member variable and one that will assign default values. You will also need to write mutator functions and accessor functions. Once you write the class, write a separate program that creates three RetailItem objects. The first one should use the default values, and the other two should have values assigned upon creation. The user should input the variables (testing for the units on hand and price greater than 0).

Then the program should display all three RetailItems. Finally, the program should tally the inventory for all three items and display it.

Welcome to the Retail store!

Price must be greater than 0.

Please enter the price for item 1: 32.

Inventory must be greater than 0.

Please enter the units on hand for item 1: 10.

Please enter the description for item 1: shirt.

Display all items

Description: shirt

Units on hand: 10

Price: $32.00

Description: Jeans

Units on hand: 40

Price: $35.95

Description: Long sleeve shirt

Units on hand: 20

Price: $25.95

Display the total inventory.

The total inventory is 70.

Press any key to continue.

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions

Question

Finding and scheduling appointments with new prospective clients.

Answered: 1 week ago