Senin, 24 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++

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY_gW7GCNPNmRTeGB7yyXYn0xlW7gN0lH0oZvjEr4xOYTWb7hE8B6_MRgelr0-nwtqTWX1WxxZOAUlfZMJkkf9sfcmEA_phioAUdDfkv5S2njnNVTAUMVsO1Ygqdni9224t2JVZ1o6i7ws/s1600/2.png

Tidak ada komentar:

Posting Komentar