I am having some issues with my case for the code. The purpose of this case is that, the user enters a number of hours and the if the hours worked by the employee is less than the hours entered by the user, it will be read from a data file and displayed. Now, if the data file has no hours worked less than hours specified by the user, it will show cout << "NO RECORDS FOUND!\n";. When i do a test run, it shows no record found, more than 1 time. How can i get out of the counter. I tried to do this with if else logic.
I am trying to look through a data file and display all the records for people whose hours worked is less than the hours user is asked to enter.
The only problem i am having is that.
if i enter 2, when asked to put in hours. NO RECORDS FOUND is written to terminal many times. What can i do, so it is only written one time.