I have tried and tried to find the information that I need for this, but I cannot seem to find it anywhere (which probably goes to show that I'm not only a pretty poor programmer, but a bad searcher, too). Anyway, I'm taking a intro to C++ course, and I am stuck on an assignment. I'm hoping someone here can help me out.
The assignment is to create a program that displays the salary of a paycode provided by the user. (Ex: The program asks for a pay code, the user enters "1" and the program produces a single "Pay code 1 makes $15000 per year." statement and asks again.). The program is also supposed to notify the user if an incorrect pay code is given (for instance, 11 in an invalid entry). The entries in the text file are set up like payCode#salary\n or 1#15000 \n 2#18000 \n, etc.
Currently, my program only displays the first line of the text file, regardless of what is input, and I have no clue as to how to test if the pay code is valid.
Any help would be greatly appreciated. Thanks, in advance!
I realize it's probably bad etiquette to push your own topics here, and I'm sorry about that. I'm just trying to find an answer to my problem. I've read through the tutorial and done many searches across the Internet. All I'm able to find is the way to display all of a text file and not a single selected line.
Sorry it took so long for any response. . . . It works with this program. There are better ways to do some of the things here but I didn't have much time to attempt involving anything I haven't formally gotten to yet.
Thanks so much. I ended up fiddling around with something that at least "works" for the assignment. I doubt it's what it's supposed to look like, but at least it works. This was the last assignment for this class that I'm taking, and it was just driving me crazy, so again; thanks for the help. I plan on continuing with studying programming in C++ after finishing with the class, so I'll be back with more questions; I'm sure. :)
No problem. I'm glad you found something that at least works. I'm just about two and a half months studying C++ myself, so I look forward to seeing you around. :)