Translate

Bu Blogda Ara

18 Haziran 2016 Cumartesi

Çalışma saatine göre maaş hesaplayan program







//40 Saatten sonrasi için saat başına yarım günlük alınıyor 40 saate kadar saat*saatlik maaş
#include <stdio.h>

#include <stdlib.h>





int main() {

float hour=0,rate,salary;





                               while(hour!=-1){

                                              

                                               printf("Please enter sum of hours worked(-1 to end)");

                                               scanf("%f",&hour);

                                               printf("Please enter hourly rate of worker(dolar)");

                                               scanf("%f",&rate);

                                               if(hour<=40){

                                                              

                                                               salary=hour*rate;

                                                               printf("Your salary is %f\n",salary);

                                                              

                                                              

                                               }else {

                                                              

                                                               salary=((hour-40)*rate/2)+40*rate;

                                                               printf("Your salary is %f\n",salary);

                                                              

                                                              

                                               }

                                                              

                                              

                               }

               

                return 0;

}

Hiç yorum yok:

Yorum Gönder