Help with functions and infiles!

I am a beginner in c++ programming and I was assigned a project to prompt the user for the name of a file. When inputted the output will be a directory containing party affiliation and office locations of the members of the House of Representatives from a particular state. It also requires the use of functions. Right now my program is not outputting the data of the files. This is what I have so far:

#include <iostream>
#include <fstream>
#include <iomanip>

using namespace std;


void programmer_info ();
void separator (int each, int lines, char sym );
void file_reader ( ifstream& inFile, int&count);
void name_printer( string first, string last);




int main()
{
int count;
string filename;
ifstream inFile;

cout << "Please enter the text file: " <<endl;
cin >> filename;

if (filename == "A3.txt")
{

separator (35, 2, '#' );

inFile.open("A3.txt");
if (!inFile)
{
cout << "Invalid file name \n\n";
return 1;
}
count = 0;
cout <<"House of Representatives from New Jersey: \n\n";

file_reader ( inFile, count);

inFile.close ();
}




if (filename == "B3.txt")
{
separator (15, 1, '*' );
inFile.clear ();
inFile.open("B3.txt");
if (!inFile)
{
cout << "Invalid file name \n\n";

return 1;
}

cout <<"House of Representatives from Virginia: \n\n";

file_reader ( inFile, count);

}
programmer_info ();

return 0;
}



void separator (int each, int lines, char sym )
{
cout << "\n\n*************************************************************************" <<endl;
cout << "|\n|\n|\n|\n|\n" ;
cout << "*************************************************************************" << endl;

}

void file_reader ( ifstream& inFile, int&count)
{

string officebuilding,firstname,lastname;
int districtnumber,roomnumber;
char party;

inFile>>districtnumber>>firstname>>lastname>>party>>officebuilding>>roomnumber;
cout << left << setw(12) << "Dist.#" << left << setw(20) << "Name" << left << setw(15) << "Party" << left << setw(15) << "Office" << left << setw(12) << "Room#" << endl;
cout << left << setw(12) << "======" << left << setw(20) << "=====" << left << setw(15) << "======" << left << setw(15) << "========" << left << setw(12) << "========" << endl;


while (inFile)
{
cout << left << setw(12);
name_printer(firstname,lastname);
cout << left << setw(25) << party << left << setw(15) << officebuilding<< left << setw(7) << roomnumber ;

cout<<endl;

inFile>>districtnumber>>firstname>>lastname>>party>>officebuilding>>roomnumber;
}

}



void name_printer( string firstname, string lastname)
{

cout << lastname +", "+ firstname;

}




some of it may be sloppy but I really do not know what else to put in the program if anyone could help Im in extreme need.
Topic archived. No new replies allowed.