In: Computer Science
C++
Using what you know about how to take inputs and make outputs to
the console, create a check printing application. Your application
will read in from the user an employee's name and salary, and print
out a Console Check similar to the following.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> | $1,000,000 | >
> >
> ___Pay to the Order of___ Johnny PayCheck >
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
If you have any doubts, please give me comment...
#include<iostream>
#include<sstream>
#include<iomanip>
#include<string>
#include<locale>
using namespace std;
int main(){
string name;
double salary;
cout<<"Employee Name: ";
cin>>name;
cout<<"Employee Salary: ";
cin>>salary;
int len = name.size();
std::stringstream ss;
ss.imbue(std::locale(""));
ss << std::fixed <<setprecision(2)<<fixed<< salary;
cout<<setw(39+len)<<setfill('>')<<">"<<endl;
cout<<setfill(' ')<<"> | $"<<setw(31+len)<<left<<ss.str()<<"| >"<<endl;
cout<<">"<<setw(37+len)<<" "<<">"<<endl;
cout<<"> ___Pay to the Order of___ "<<name<<" PayCheck >"<<endl;
cout<<setw(39+name.size())<<setfill('>')<<">"<<endl;
return 0;
}