Selasa, 25 Maret 2014

Ebooks Chapter 5 PROBLEM SOLVING AND PROGRAM DEIGN IN C

Diposting oleh Unknown di 09.27
5.3 Figure 5.4 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;
}

C++ :


0 komentar:

Posting Komentar

 

Rizka Site Copyright © 2012 Design by Antonia Sundrani Vinte e poucos