I have been working on this program for about two weeks. I missed the day that the professor covered the material necessary to code this program due to surgery. I am now behind about 5 programs that are due at the end of the week and I'm trying to teach myself what I've missed. I have asked classmates for help and what they have told me has not been working. If anyone has the free time, I would absolutely love it if you could debug this program for me. I know this community is NOT for giving homework answers. I wrote all this code on my own and cannot figure out why if won't display the correct values in their respective places in the formatting. It is a program that we were assigned in a lab one day. The program is supposed to input a name and a pay rate from a data file, and then calculate the net pay and print it to an output file in a check format. The formatting is correct but the numbers are wrong. Please help.
#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
using namespace std;
// Named constant definitions (and function declarations):
ifstream inData;
ofstream outData;
// Main program:
int main()
{
// Variable declarations:
// Insert declarations from various parts below, as needed
float net;
float hrs;
float rate;
int dollars;
float cents;
string payto;
string date;
// Function body:
// Insert code from Part I algorithm - inputting data from file
inData.open("wages.dat");
outData.open("check.out");
getline(inData,payto);
inData >> payto;
inData >> rate;
// Insert code from Part II algorithm - calculating net pay
cout << "Please enter the total hours worked." << endl;
cin >> hrs;
cout << "Please enter today's date (ex. MM/DD/YYYY)." << endl;
cin >> date;
cout << endl;
net = hrs * rate;
// Insert code from Part III algorithm - determining dollars and cents
dollars = net;
cents = (net - dollars) * 100;
// Insert code from Part IV & V of algorithm - printing check to datafile
outData << endl << "12432 Somewhere St." << endl << setw(48) << left << setfill (' ') << "Russellville, AR 72802";
outData << setw(13) << setfill(' ') << right << date << setw(12) << right << setfill('_') << "Date" << endl;
outData << endl;
outData << setw(7) << left << setfill('_') << "Pay" << setw(47) << left;
outData << setfill('_') << payto << " $" << setw(15) <<setprecision(2) << showpoint << fixed << net;
outData << endl << endl << setw(18) << right << setfill(' ') << dollars << "_Dollars_&_";
outData << cents << '_' << setw(18) << left << setfill(' ') << "Cents" << endl << endl;
outData << endl << setw(43) << left << setfill(' ') << "Bank of Foundations I" << setw(30);
outData << right << setfill('_') << '_' << endl;
// Remove block commet notation before beginning to make code visible
inData.close();
outData.close();
return 0;
} // end function main