我在编码时遇到问题

  • 本文关键字:遇到 问题 编码 c++
  • 更新时间 :
  • 英文 :


因此,以下是我需要对进行编码的内容

我在如何修复我的编码方面遇到了麻烦,我还是编码的新手,所以请耐心等待。我不知道我应该如何修复编码。我不太确定我的一些编码是正确的还是全部不正确的

以下是我现在得到的错误(更新(

编辑:感谢您了解EmployeeNo;(我现在解决了(

float HourlyPay;
float WeeklyHours;
float RegularHours;
float OvertimeHours;
float RegularPay;
float OvertimeWeekly;
float OvertimePay;
float GrossPay;
float EmployeeNo;
char tryAnother;


do{

system("CLS");
printf("Please Input Employee No:");
scanf("%f", &EmployeeNo);


do{
printf("No. of hours worked in a week:");
scanf("%f", &WeeklyHours);

OvertimeWeekly = WeeklyHours - 40;

printf("No of hours of Overtime worked for the week");
scanf("%d", &OvertimeWeekly);

printf("Hourly Pay Rate (PHP):");
scanf("%d", &HourlyPay);

if (OvertimeWeekly < 0) {
OvertimeWeekly = 0;
}
else if (WeeklyHours <= 40) {
RegularHours = WeeklyHours;
OvertimeHours = 0;
}
else if (WeeklyHours > 40) {
RegularHours = 40;
OvertimeHours = WeeklyHours - 40;
}
}
do{
printf("Try Another [Y/N]: ");
scanf(" %c", &tryAnother);
if  (tryAnother != 'N' && tryAnother != 'Y')
printf("Invalid, Please Try Againn");

}while (tryAnother != 'N' && tryAnother != 'Y');
}while (tryAnother != 'N' );

printf("Exiting Program");
return 0;
}

float GrossPay;
float EmployeeNo  // <-- You're missing a ';' here
char tryAnother;

最新更新