Please prove the whole, correctly, typed C++ code following the Requirement blew
ID: 3872083 • Letter: P
Question
Please prove the whole, correctly, typed C++ code following the Requirement blew, and typed first name as Junhua, last name as Dong as the excess example.
Thank you very much!
Requirements:
create a pay scale including following:
" 1. ask the user to enter there First name and Last name;
2. also ask the user the Hours worked;
3. need hourly pay rate to be a constant variable. you can determine what "you" want there hourly pay rate to be.
Next need to calculate the persons pay, therefore need the biweekly pay, monthly pay and yearly pay.
I want set precision(want set precision set to "2" and setw set "5" )
Lastly need to output the user's first and last name and the biweekly, monthly and yearly pay."
Explanation / Answer
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
string firstname,lastname;
int hours;
cout<<"Enter FirstName"<<endl;
cin>>firstname;
cout<<"Enter LastName"<<endl;
cin>>lastname;
cout<<"Enter your working hours per day"<<endl;
cin>>hours;
double ratePerHour=4.2; //default value price per hour
cout << setw (5);
cout<<setprecision(2);
cout<<fixed;
cout <<"Firstname: "<<firstname << endl;
cout <<"Lastname: "<< lastname << endl;
cout <<"working hours: "<<hours << endl;
cout << setw (5);
cout<<setprecision(2);
cout<<"per day amount "<<(hours*ratePerHour)<< endl;
cout << setw (5);
cout<<setprecision(2);
cout<<fixed;
cout<<"per week amount "<<(hours*ratePerHour)*7<< endl;
cout << setw (5);
cout<<setprecision(2);
cout<<fixed;
cout<<"per month amount "<<(hours*ratePerHour)*30<< endl;
cout << setw (5);
cout<<setprecision(2);
cout<<fixed;
cout<<"per year amount "<<(hours*ratePerHour)*365<< endl;
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.