- 5.2 Figure 5.2 Program Fragment With a Loop
#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