Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main()
- {
- float salaryPerWeek, totalHours, salPerHour, hoursOver, salPerHourOver, endSal;
- while(1)
- {
- printf("Enter a salary per week:\n");
- scanf("%f", &salaryPerWeek);
- printf("Enter total number of hours worked:\n");
- scanf("%f", &totalHours);
- if(totalHours > 168)
- {
- printf("There are only 168 hours in a week...");
- } else if(totalHours < 40)
- {
- printf("You need to work at least 40 hours...");
- }
- salPerHour = salaryPerWeek / 40;
- hoursOver = totalHours - 40;
- //salPerHourOver = hoursOver * (salPerHour * 2);
- endSal = salaryPerWeek + (hoursOver * salPerHour * 2);
- printf("Here is the person's salary after 1 week: %f", &endSal);
- printf("\n\n");
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment