Minggu, 23 Maret 2014

Pertemuan 04. Ebook Program to Compute Company Payroll

include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    int count_emp=0, number_emp;
    double rate,pay,total_pay=0,hours;
   
    cout<<"Enter number of employees> ";
    cin>>number_emp;
   
    while(count_emp<number_emp){
    cout<<"Karyawan "<<count_emp+1<<endl;
    cout<<"Hours> ";
    cin>>hours;
    cout<<"Rate> ";
    cin>>rate;
    pay= hours*rate;
    cout<<"Pay is= $ "<< pay<<endl;
    total_pay=total_pay+pay;
    count_emp=count_emp+1;
}

 cout<<"All employees processed"<<endl;
 cout<<"Total payroll is " <<total_pay<<endl; 
   
    system("PAUSE");
    return EXIT_SUCCESS;
}

Bahasa c++




Tidak ada komentar:

Posting Komentar