Hi, I'm really stuck with this program and this assignment is due tomorrow. I would really appreciate if someone can help me. For the assignment i had to 1.create a text file, 2. declare a stream, 3. open my text file, 4. check that the open did not fail, 5.display the name of my store, 6. read the inventory from a file into arrays- the item number, quantity of the item, and name of the item. the program should read the whole file, no matter how many items are in it. 7. In a loop until the user enters STOP, it should display the item number and name on the screen. and ask the user what he or she would like to buy and how many. If the user orders more than in inventory- error message. 8. close the stream, and 9. print the final inventory. Now i wrote the program but it's unable to open the file and i'm not able to do parts 6 and 7. PLEASE HELP ME. THank you!
You are declaring the variable end as a character variable, but are asking the user to input a string, "stop", 'stop' is not a valid character. Change the variable type to string, and replace the ' around the conditionals with double "