Okay So I started writing this for extra credit, but damn i need decimal , and when i try to insert something that isnt a whole number i have a problem so if its not int, is it float? and where in the code does it go? Then i need a loop to repeat it 5 times which i am totally lost...... yes i am noob:*(
Write a program that reads in the name, hourly rate and number of hours worked for 5 people. Print the name of each person, the number of hours worked, their weekly pay based on the number of hours they worked and how much they owe in taxes. Assume that taxes take 20% of the paycheck. Don’t forget to take the taxes out of the pay check. If they work more than 40 hours they get overtime. The hourly rate is then 1.5 times normal for all hours past 40.
Example (Sample input & output for one person)
Enter name: Glenn
Enter hourly rate: 4.00
Enter hours worked: 75
Pay to: Glenn
Hourly rate: 4.00
Hours worked: 75.0
Amount paid: $370.00
Taxes paid: $74.00
My Code:
#include<stdio.h>
int main()
{
int hoursWorked;
int hourlyRate;
int sum;
printf("Glenn\n");
printf("Hours Worked\n");
scanf("%d", &hoursWorked);
printf("Hourly Wage\n");
scanf("%d", &hourlyRate);
sum = hoursWorked * hourlyRate;
printf("The Total Is %d", sum);
getch();
return 0;
}