I have written the code, displaying a menu to the user so they can select a payrate, and once they have done that they need to enter amount of hours worked. From there I am trying to calculate total gross pay, taxes, and net pay before the loop ends. I need to use #defined constants, with tax being 15% of the first $300. Or at the very least how and where would I add in a simple calculation for the pay rate multiplied by hours?
#include <stdio.h>
#include <ctype.h>
int main(void)
{
int pick;
int hours;
float total;
do {
printf_s("************************************************\n");
printf_s("Enter the number corresponding to the desired pay rate or action:\n");
printf_s("\n1) $8.75/hr\n");
printf_s("\n2) $9.33/hr\n");
printf_s("\n3) $10.00/hr\n");
printf_s("\n4) $11.20/hr\n");
printf_s("\n5) quit\n");
printf_s("************************************************\n");
scanf_s("%d", &pick);
printf("Enter the number of hours: \n");
scanf_s("%d", &hours);
switch (pick)
{
case 1: total = hours * 8.75;
break;
case 2: total = hours * 9.33;
break;
case 3: total = hours * 10.00;
break;
case 4: total = hours * 11.20;
break;
case 5:
break;
return 0;
}
} while (pick != 5);
}