simplificating integer verification with an option of ctrl-z quit cin.eof

This was part of my homework problem. This is the code I ended up with that works for what was required, but wanted to know if there is a simpler way to do this problem? Really I would prefer not to use breaks, but not really sure how without them...Any input is appreciated as I just want to understand for future assignments!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
do
	{
		cout << "\nEnter the homework score, or Ctrl-z to quit: ";
	    cin >> aNumber;
		if(cin.eof())
		{
			done=false;
			break;
		}
		while(!cin)
		{
			cout << "That was not an integer! Please enter an integer: ";
			cin.clear();
			cin.ignore();
			cin >> aNumber;
			if(cin.eof())
			{
				done=false;
				break;
			}
		}
			myVector.push_back(aNumber);
		
		
	}while(done==true);
Topic archived. No new replies allowed.