void main (void)
{
vector<int> hours(3);
vector<float>payrate(3);
cout<< "enter the hours worked by 3 employees\n";
cout << "and their hourly rates\n";
for ( int i=0;i<3;i++)
{
cout <<"hours worked by employee #" << ( i+1);
cout << ":";
cin >> hours[i];
cout << "hourly payrates for employee #";
cout << (i + 1) << ":";
cin >> payrate[i];
}
cout << "gross pay for each employee are as under: \n";
cout.precision(2);
cout.setf(ios::fixed | ios::showpoint );
for(int i=0;i<3;i++)
{
float grosspay= hours[i] * payrate[i];
cout << "employee #" << ( i+1);
cout << " : $" << grosspay << endl;
}
}
Get Answers For Free
Most questions answered within 1 hours.