Im trying to make a while loop but im not sure on how to do it. In the program I need to ask the user how many employees payroll they need to calculate and use a while loop to validate that the number of employees entered is 5 or less and use this number of employees inside of a for loop to run the program that many times. (Display the number each time you run the loop as "Employee #1", etc.)
[Code]
#include <iostream>
using namespace std;
int main()
{
double x,y,taxrate,grosspay,tax,netpay;
int main()
{
int variable = 0;
std::cin >> variable;
while( variable < 5 )
{
// do stuff
// increment the variable, else
// it will be an infinite loop
++variable;
}
return 0;
}