I'm having trouble with this homework problem. I know I'm close to having it solved but I can't get the loop to stop. It finds the correct name to the parking sticker in the text file but keeps looping over and over. Here's the problem for a better understanding:

Assume that a file named HWK5.txt has a single name (last name only -- no first name or middle initial) and a parking sticker number (6 digits) on each line of the file. It is unknown how many names are on the file. (You will need to make up a test file to use.) Write a program that will ask the user for a parking sticker number (000000 to stop) and then search the file for that number. When it finds the number in the file, it will write out "This parking sticker belongs to " followed by the corresponding name on the file, or if the sticker number is not found on the file, the message "This parking sticker is not on file. Try again." should be displayed. The program will then ask for another sticker number and repeat until a sticker number of 000000 (or just plain zero) is entered. To perform the search, the parking sticker number should be sent to a function called findName, which you will write. The function findName should open the file HWK5.txt, search it for the given sticker number, and return the corresponding name to the calling program. Before it returns, the function should close the file HWK5.txt so that it will be ready to be used for the next search. If the sticker number is not found on the file, the function should return a value of "NOT FOUND" to the calling program. The function should NOT display anything on the screen; the main function should handle this task, as well as prompting for the next sticker number.

I'm not understanding the bold portion of the problem and in turn is probably what is causing my trouble. Here is the work I have so far:

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main()
{
string lastName;
double number, target, parkingSticker;
const double SENTINEL = 000000;

cout << "Please enter a parking sticker number (enter 000000 to exit): " << endl;
cin >> target;

while (target != SENTINEL)
{
ifstream input("HWK5.txt");
if (input.is_open())
{
while (! input.eof())
{
input >> lastName >> parkingSticker;
if (target == parkingSticker)
cout << "The parking sticker number belongs to " << lastName << endl;
else
cout << "This parking sticker is not on file. Try again." << endl;
}
}
input.close();
}
system("pause");
return 0;
}

The function is working correctly as far as finding the correct name to the parking sticker number. It just displays:

The parking sticker number belongs to Smith
This parking sticker is not on file. Try again.
The parking sticker number belongs to Smith
This parking sticker is not on file. Try again.
The parking sticker number belongs to Smith
This parking sticker is not on file. Try again.
::repeats this over and over::

Just wondering how I'm suppose to stop it from looping over and over and not display the second message if it actually finds the parking sticker number. Any help would be greatly appreciated.