The Aristocats - Marie

animasi

TUGAS KELOMPOK (EBOOK CHAPTER 5 Problem Solving and Program Design in C)

Sabtu, 22 Maret 2014

  •  5.2 Figure 5.2 Program Fragment With a Loop
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
int count_emp=0,hours;
float rate,pay;

while(count_emp<7){
    cout<<"Hours> ";
    cin>>hours;
    cout<<"Rate> ";
    cin>>rate;
    pay= hours*rate;
    cout<<"Pay is= $ "<< pay <<endl;
    count_emp=count_emp+1;
}

 cout<<"All employees processed"<<endl;
 
    system("PAUSE");
    return EXIT_SUCCESS;
}

RUN :

0 komentar:

Posting Komentar