- #1
NDiggity
- 54
- 0
Homework Statement
I have to write a function that first prints a list of 6 choices, tells a user to choose one of the six choices using the number 1-6, then either return the number they chose or -99 if they chose a number less than one or greater than 6. Then, I have to call this function and if they chose a number between 1 and 6, report this number, but if they chose outside of the range, print you did not choose a stock.
The Attempt at a Solution
I have the function done. I just don't know how to go about calling it. What I have now is:
if(stockMenu() ==-99)
cout<<"You did not choose a stock"
else
cout<<stockMenu()
Obviously you can see the problem with this way, as the function runs twice. How can I do this?
Last edited: