A c program that print salary | Sololearn: Learn to code for FREE!

0

# A c program that print salary

please someone should help me with a program that accept staff Id, total work hour per week, and print the total result for a monthly and salary Note: 3.3 hours per day, \$2 per hour Thanks

8/5/2021 9:49:44 AM

+8

+3

A͢J - S͟o͟l͟o͟ H͟e͟l͟p͟e͟r͟ #include<stdio.h> int main() { char id[10]; int hour; double value,salary; printf("Input the Employees ID( Max. 10 chars):"); scanf("%s",&id); printf("\nInput the working hrs per week: "); scanf("%d",&hour); printf("\nSalary amount/hr: "); scanf("%lf",&value); salary=value*hour; printf("\nEmployees ID = %s\nSalary = U\$ %.2lf\n",id,salary); return 0; }

+2

Rishi this fits thank you so much 😃but there’s a little changes to make

+2

Subad Your calculation should be working_hour_per_day = total_working_hour_per_week / 7; total_monthly_working_hour = 30 * working_hour_per_day; total_monthly_salary = total_monthly_working_hour * amount_per_hour; But I have a question: In this case what is the use of 3.3 hours per day if employees have total_work_hour_per_week? 2nd what would be if 3.3 * 7 = 23.1 hours_per_week is less than or greater than from total_work_hour_per_week?

0

0

Simba input should be number of total work hour per week and output should be total salary in a month

0

Subad In description hour per week and in notes 3.3 hours per day. I didn't get this. Ans what is \$2 per hour?

0

A͢J - S͟o͟l͟o͟ H͟e͟l͟p͟e͟r͟ I mean each one hour the employee should be paid \$2 and the maximum hour a day is 3.3 hours

0