Payment Calculation for Part Time Employees (Id-3453)
Part-time employees are paid ‘x’ amount for each 40-hours they work and for the remaining hours they are paid ‘y’ amount. A part-time employee has worked ‘z’ hours per day for six days. Given the value of ‘x’ and ‘y’ and ‘z’, develop an algorithm and write a C code to find the amount to be paid. For example, if the value of x is 2000, ‘y’ is 100 and ‘z’ is 15 then the amount to be paid is 5000.
Input Format
First line contains amount paid for each 40 hours, x
Second line contains amount paid for each extra hour, y
Third line contains number of hours worked per day, z
Output Format
Print the amount to be paid sol:-
C-CODE:
#include<stdio.h>
int main()
{int x,y,z;
scanf("%d",&x);
scanf("%d",&y);
scanf("%d",&z);
printf("%d",x*((6*z)/40)+y*((6*z)%40));}
int main()
{int x,y,z;
scanf("%d",&x);
scanf("%d",&y);
scanf("%d",&z);
printf("%d",x*((6*z)/40)+y*((6*z)%40));}
0 Comments