Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming with c++ Write a windows console application that holds data about an item in a retail store. Your class should be named Retailltem and

Programming with c++

image text in transcribedimage text in transcribed
Write a windows console application that holds data about an item in a retail store. Your class should be named Retailltem 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, unitsDnHand int that holds the number of units in inventory price double that holds the price of the item 1'I"ou will need two constructors, one that will accept argumen'ls for esach member variable and one that will assign default values. You will also need to write mutator functions and aooessor functions. Once you write the class, write a separate program that creates three Retailltem 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 D}. Then the program should display:r all three Retailltems. Finally the program should talla,'T the inventorv for all three items and displav it. Welcome to the ltetail store! Price must be greater than ID. Please enter the price for item 1: 33 Inventor',' must be greater than D. Please enter the units on hand for item 1: ID Please enter the description for item 1: shirt Displav all items Description: shirt Units on hand: 10 Price: 533110 Description: Jeans Units on hand: III-D Price: $34.55 Description: Long sleeve shirt Units on hand: 20 Price: $24.55 Displav the total inventorv The total inventor',r is TD Press any he'llr to continue . . . Step 2: Processing Logic You will create a Retailltem 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 Retailltem 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 Retailltem Class Implement all member functions Create a Retailltem.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

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

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions