我在解决编码方面遇到麻烦,对编码来说还很陌生,请耐心等待。我不知道该如何解决编码问题,我不确定自己的编码是否正确
Here are the errors im getting now (Updated)
编辑:感谢您告知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 Again\n");
}while (tryAnother != 'N' && tryAnother != 'Y');
}while (tryAnother != 'N' );
printf("Exiting Program");
return 0;
}
答案 0 :(得分:1)
float GrossPay;
float EmployeeNo // <-- You're missing a ';' here
char tryAnother;