I'm having some trouble some parts of a progarm. I have to write a progarm which allows a user to enter inventory data for item in a store. This data should be stored in a text file on disk, with each items data on a single line. The data for each item must be entered on separate lines
with separate prompts is this order:
Stock Number (at most 5 characters long)
Quantity in stock
I can assume the user will enter numeric values for price and quantity.
The progarm should validate the price to require it to be between 0.00 and 10000.00. Repeatedly prompt for the price until it is within that range. However, if the user enters -999.00, escape from the validation loop and abandon that record. In other words, if the user enters an illegal value, ask for it again and agin until the user enters a valid number or enters -999.00, then abandon that record and start prompting for a new record by asking for its stock number.
I dont need to validate the other data for this progarm.
Store the data on a disk with one record on each line of the file with the fields in the order shown above.
This program should prompt the user for a name of the flie to be created. If the user just presses <enter>, then the progarm should use the default name of "stock.dat" If the user does not include an extention on the file name, the progarm should append ".dat" to the user's file name.
This is what I have so far:
Most my problems are in the validation. I cant seem to validate the data correctly. If anyone can help at all, I thank you for it.
Most of these headers do not exist in standard C++ (according to the 10 year old standard). Considering the exercise, it is also unclear why you include things like stdio.h or ctype.h. Try starting anew with