Description

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.

  • Description - string holding the description of the item,
  • unitsOnHand - int that holds the number of units in inventory
  • Price - double 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: 33

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: $33.00

Description: Jeans
Units on hand: 40
Price: $34.95

Description: Long sleeve shirt
Units on hand: 20
Price: $24.95

Display the total inventory.
The total inventory is 70.
Press any key to continue.

Be sure to think about the logic and design first, then code the C++ program.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.