C++ C++;如果不符合条件,则为数据输入创建循环

C++ C++;如果不符合条件,则为数据输入创建循环,c++,C++,我已经很长时间没有编程了,我的问题如下 我希望创建一个循环,如果输入的工资率不正确,该循环将返回到入口点。我希望它打印出错误通知,如果它不符合标准,否则转到您已经满足标准。我还得到一个关于字符串劳动者的数据类型的错误,因为它没有被定义。智能感知:标识符“劳动者”未定义。我一直在努力解决这个问题,如下所示。任何指示都将不胜感激 #include "stdafx.h" #include "stdlib.h" #include <iostream> #include <iomanip

我已经很长时间没有编程了,我的问题如下

我希望创建一个循环,如果输入的工资率不正确,该循环将返回到入口点。我希望它打印出错误通知,如果它不符合标准,否则转到您已经满足标准。我还得到一个关于字符串劳动者的数据类型的错误,因为它没有被定义。智能感知:标识符“劳动者”未定义。我一直在努力解决这个问题,如下所示。任何指示都将不胜感激

#include "stdafx.h"
#include "stdlib.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cctype>  
#include <conio.h>
#include <cstdlib> 
#include <cstring>
using namespace std;

int eel;
int hpr;
int kbhit()

void pause()
{
     cout << "Press any key to continue....";
     while(1)
     {            
          if(kbhit())
          {
               break;
          }
     }
}     

int _tmain(int argc, _TCHAR* argv[])
{
    int eel = Laborer;
    int hpr = 0;


    while (hpr < 20.00 || hpr >49.99)
    {
        cout <<"\n\t\t Enter Allowable Pay Rate For The Employee Position."<<endl;
        cout <<"\n\n\t\t =====================================================";
        cout <<"\n\t\t The Allowable Pay Rate Is: 20.00 to 49.99 per hour."<<endl;
        cout <<"\n\n\t\t =====================================================";
        cout <<"\n\t\t Enter Correct Pay Rate For The Position of "<<eel <<": ";
        cin >> hpr;
        cout <<"\n\n\t\t =====================================================";

        if (hpr < 20.00 || hpr >49.99){
        {
            cout<<"\n\n\t\t XX ERROR! ERROR! XX";
            cout<<"\n\n\t\t YOU HAVE ENTERED AN INCORRECT PAY RATE FOR THE POSITION";
            cout<<"\n\n\t\t PLEASE RE-ENTER THE CORRECT RATE FOR THE POSITION";
        }
            if (hpr >= 20  &&  hpr <= 49.99)
            {
                cout<<"\n\n\t\t =========================================================";
                cout<<"\n\t\t You Entered a Correct Pay Rate for the Position of "<< eel <<endl;
                cout<<"\n\t\t Employee Hourly Payroll Rate Is: "<<hpr <<endl;
                cout<<"\n\n\t\t =========================================================";
            }
            pause();          //To stop program to see if the loop is correct
        }
}
#包括“stdafx.h”
#包括“stdlib.h”
#包括
#包括
#包括
#包括
#包括
#包括
#包括
使用名称空间std;
鳗鱼;
int-hpr;
int kbhit()
无效暂停()
{
cout(49.99)
{

cout您不能将未知变量'labour'分配给整数。根据您的目标外观。。
我想你需要在这里做的是将
int-eel=labor;
更改为
string-eel=“labor”
int-eel=labor;
-应该从哪里来?我在其他任何地方都看不到它,所以Intellisense也找不到它似乎是合乎逻辑的。(标题中的问题/任务与错误无关。)//设置Calcs的工作位置//如果(eelevel=1){eel=labor;}如果(eelevel=2){eel=Staff;}如果(eelevel=3){eel=助理经理;}如果(eelevel=4){eel=经理;}库特