#include <iostream>
#include <cmath>
usingnamespace std;
void tax(float r, double x, double y, float z)
{
cout<<"Please input the cost of an item: ";
cin>>x;
cout<<"\n";
y='.08';
r='x*y';
cout<<"Tax on most items today is 8% of the total cost."<<endl;
cout<<x*y<<" is how much you will be taxed on that purchase."<<endl;
cout<<" "<<endl;
cout<<"The total cost after tax is, "<<floor((r+x)+0.5)<<endl;
}
int main()
{
float r;
double x;
double y;
float z;
cout<<"======================================================\n";
cout<<"| WELCOME TO MY TEXT BASED TAX CALCULATOR |"<<endl;
cout<<"| |"<<endl;
cout<<"| This calculator was written in c++ by John McCrary |"<<endl;
cout<<"======================================================\n";
tax(r, x, y, z);
return 0;
}
the output is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
======================================================
| WELCOME TO MY TEXT BASED TAX CALCULATOR |
| |
| This calculator was written in c++ by John McCrary |
======================================================
Please input the cost of an item: 10
Tax on most items today is 8% of the total cost.
3.027e+07 is how much you will be taxed on that purchase.
The total cost after tax is, 7.8752e+06
(program exited with code: 0)
Press return to continue