18.07.2017 Views

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Write</strong> a <strong>w<strong>in</strong>dows</strong> <strong>console</strong> <strong>application</strong><br />

<strong>that</strong> <strong>holds</strong> <strong>data</strong> <strong>about</strong> <strong>an</strong> <strong>item</strong> <strong>in</strong> a<br />

<strong>retail</strong> <strong>store</strong><br />

BUY HERE⬊<br />

https://www.homeworkmade.com/write<br />

-a-<strong>w<strong>in</strong>dows</strong>-<strong>console</strong>-<strong>application</strong>-<strong>that</strong><strong>holds</strong>-<strong>data</strong>-<strong>about</strong>-<strong>an</strong>-<strong>item</strong>-<strong>in</strong>-a-<strong>retail</strong><strong>store</strong>/<br />

<strong>Write</strong> a <strong>w<strong>in</strong>dows</strong> <strong>console</strong> <strong>application</strong> <strong>that</strong> <strong>holds</strong> <strong>data</strong> <strong>about</strong> <strong>an</strong> <strong>item</strong> <strong>in</strong> a <strong>retail</strong> <strong>store</strong>.<br />

Your class should be named RetailItem <strong>an</strong>d should hold <strong>data</strong> <strong>about</strong> <strong>an</strong> <strong>item</strong> <strong>in</strong> a <strong>retail</strong> <strong>store</strong>. The class will have<br />

the follow<strong>in</strong>g member variables.<br />

description—str<strong>in</strong>g hold<strong>in</strong>g the description of the <strong>item</strong><br />

unitsOnH<strong>an</strong>d—<strong>in</strong>t <strong>that</strong> <strong>holds</strong> the number of units <strong>in</strong> <strong>in</strong>ventory<br />

price—double <strong>that</strong> <strong>holds</strong> the price of the <strong>item</strong><br />

You will need two constructors, one <strong>that</strong> will accept arguments for each member variable <strong>an</strong>d one <strong>that</strong> will<br />

assign default values. You will also need to write mutator functions <strong>an</strong>d accessor functions. Once you write the<br />

class, write a separate program <strong>that</strong> creates three RetailItem objects. The first one should use the default<br />

values, <strong>an</strong>d the other two should have values assigned upon creation. The user should <strong>in</strong>put the variables<br />

(test<strong>in</strong>g for the units on h<strong>an</strong>d <strong>an</strong>d price greater th<strong>an</strong> 0).<br />

Then the program should display all three RetailItems. F<strong>in</strong>ally, the program should tally the <strong>in</strong>ventory for all<br />

three <strong>item</strong>s <strong>an</strong>d display it.<br />

Welcome to the Retail <strong>store</strong>!<br />

Price must be greater th<strong>an</strong> 0.<br />

Please enter the price for <strong>item</strong> 1: 33.<br />

Inventory must be greater th<strong>an</strong> 0.<br />

Please enter the units on h<strong>an</strong>d for <strong>item</strong> 1: 10.<br />

Please enter the description for <strong>item</strong> 1: shirt.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!