Loop Gross Pay (for,while)

I am stuck in looping a program -
Enter years worked

1
2
3
4
5
6
7
8
9
10
11
12
13
cin >>years;
	  while (years >=.99)
	  {
		  
	  cout << "Enter hours worked: ";
	  cin >> hourw;
	  cout << "Enter hourly rate: ";
	  cin >> rate;      
      
	  if (hourw > 40)
       
         overtime =hourw-40;
         hourw=40;

This works except when loops back it starts back at enter hourw (hour worked)function well with no errors - but it does not start over at enter years..
I just need a push or shove or kick in the right direction
Thank you
Last edited on
The loop returns each time to the start of the loop; the start of the loop is the first brace { after while (years >=.99)

The code to enter the years is not inside the loop, so it will not be repeated each time the loop is repeated.
Last edited on
Topic archived. No new replies allowed.