given; a progam in c++: #include <iostream> using namespace std; int main() { do
ID: 3670517 • Letter: G
Question
given; a progam in c++:
#include <iostream>
using namespace std;
int main()
{
double rate, hours;
int id;
char code;
//prompt user for imput
cout << "enter the floating point rate of pay "
<< " and hours worked: ";
cin >> rate >> hours;
cout << " enter the employee's integer id : ";
cin >> id;
cout << " enter the tax code (h,r,l): ";
cin >> code;
cout << rate << endl << hours << endl <<
id << endl << code << endl;
return 0;
question:Update the code so that the output is in a more user-friendly format as shown here:
Explanation / Answer
#include <iostream>
using namespace std;
int main()
{
double rate, hours;
int id;
char code;
//prompt user for imput
cout << "enter the floating point rate of pay "<< " and hours worked: ";
cin >> rate >> hours;
cout << " enter the employee's integer id : ";
cin >> id;
cout << " enter the tax code (h,r,l): ";
cin >> code;
cout <<" The hourly rate: "<< rate << endl;
cout<<"The hours "<< hours << endl;
cout<<"The employee id "<<id << endl;
cout<<"The tax code is "<< code << endl;
cout<<"Press any key to contunue....."<<endl;
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.