That was cut/pasted from the .txt file, and the '.'s are periods. I'm opening it in Notepad, and I'm using whatever the default fonts are.
This is an exercise from "C++ Programming" by D.S. Malik - it's early in the book so there are no loops or functions.
Code:
#include<iostream>
#include<fstream>
#include<iomanip>
using namespace std;
int main()
{
const int Fed = 15, PP = 5;
const double State = 3.5, SS = 5.75, MM = 2.75, Health = 75;
double Gross, Temp, Net;
string Name;
const int c1=30, c2 = 8;
ofstream outFile;
outFile.open("E:\\paycheck.txt");
cout<<"Please enter your name: ";
getline(cin,Name);
cout<<"and your gross pay: ";
cin>>Gross;
cout<<endl;
Net = Gross;
cout<<Name<<endl;
cout.fill('.');
cout<<fixed<<showpoint<<setprecision(2);
cout<<left<<setw(c1)<<"Gross Amount: "<<" $";
cout.fill(' ');
cout<<right<<setw(c2)<<Gross<<endl;
Temp = Gross*Fed/100;
Net=Net-Temp;
cout.fill('.');
cout<<left<<setw(c1)<<"Federal Tax: "<<" $";
cout.fill(' ');
cout<<right<<setw(c2)<<Temp<<endl;
Temp = Gross*State/100;
Net=Net-Temp;
cout.fill('.');
cout<<left<<setw(c1)<<"State Tax: "<<" $";
cout.fill(' ');
cout<<right<<setw(c2)<<Temp<<endl;
Temp = Gross......../100;
Net=Net-Temp;
cout.fill('.');
cout<<left<<setw(c1)<<"Social Security Tax: "<<" $";
cout.fill(' ');cout.fill(' ');
cout<<right<<setw(c2)<<Temp<<endl;
Temp = Gross*MM/100;
Net=Net-Temp;
cout.fill('.');
cout<<left<<setw(c1)<<"Medicare/Medicaid Tax: "<<" $";
cout.fill(' ');
cout<<right<<setw(c2)<<Temp<<endl;
Temp = Gross*PP/100;
Net=Net-Temp;
cout.fill('.');
cout<<left<<setw(c1)<<"Pension Plan: "<<" $";
cout.fill(' ');
cout<<right<<setw(c2)<<Temp<<endl;
Net=Net-Health;
cout.fill('.');
cout<<left<<setw(c1)<<"Health Insurance: "<<" $";
cout.fill(' ');
cout<<right<<setw(c2)<<Health<<endl;
cout.fill('.');
cout<<left<<setw(c1)<<"Net Pay: "<<" $";
cout.fill(' ');
cout<<right<<setw(c2)<<Net<<endl;
// Here's the outFile part
outFile<<Name<<endl;
outFile.fill('.');
outFile<<fixed<<showpoint<<setprecision(2);
outFile<<left<<setw(c1)<<"Gross Amount: "<<" $";
outFile.fill(' ');
outFile<<right<<setw(c2)<<Gross<<endl;
Temp = Gross*Fed/100;
Net=Net-Temp;
outFile.fill('.');
outFile<<left<<setw(c1)<<"Federal Tax: "<<" $";
outFile.fill(' ');
outFile<<right<<setw(c2)<<Temp<<endl;
Temp = Gross*State/100;
Net=Net-Temp;
outFile.fill('.');
outFile<<left<<setw(c1)<<"State Tax: "<<" $";
outFile.fill(' ');
outFile<<right<<setw(c2)<<Temp<<endl;
Temp = Gross......../100;
Net=Net-Temp;
outFile.fill('.');
outFile<<left<<setw(c1)<<"Social Security Tax: "<<" $";
outFile.fill(' ');cout.fill(' ');
outFile<<right<<setw(c2)<<Temp<<endl;
Temp = Gross*MM/100;
Net=Net-Temp;
outFile.fill('.');
outFile<<left<<setw(c1)<<"Medicare/Medicaid Tax: "<<" $";
outFile.fill(' ');
outFile<<right<<setw(c2)<<Temp<<endl;
Temp = Gross*PP/100;
Net=Net-Temp;
outFile.fill('.');
outFile<<left<<setw(c1)<<"Pension Plan: "<<" $";
outFile.fill(' ');
outFile<<right<<setw(c2)<<Temp<<endl;
Net=Net-Health;
outFile.fill('.');
outFile<<left<<setw(c1)<<"Health Insurance: "<<" $";
outFile.fill(' ');
outFile<<right<<setw(c2)<<Health<<endl;
outFile.fill('.');
outFile<<left<<setw(c1)<<"Net Pay: "<<" $";
outFile.fill(' ');
outFile<<right<<setw(c2)<<Net<<endl;
outFile.close();
cin.ignore();
cin.get();
return 0;
}