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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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 esach 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 . . .

   

Step 2: Processing Logic


You will create a RetailItem class, a main program and a RetailItem.h for a total of three files as a demonstration of understanding, creating, and using classes.

 

Using the pseudocode below, write the code that will meet the requirements.

 

Create a Main program

      Create three RetailItem objects

       Ask user for price for item1 looping until value is greater than 0

                   Ask user for unitsOnHand for item2 looping until value is greater than 0

                   Ask user for description for item 1

                    Display all items

                   Add up total inventory and display total inventory

 

Create a RetailItem Class

         Implement all member functions

Create a RetailItem.h

       Private member variables should be description, unitsOnHand, and price

         Public member functions include both constructors, and mutator and accessor functions for all three variables

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education