Alright, here's what's up. My teacher assigned us a project that involved us creating a "pay roll" program. This program had to allow him to edit pay rolls, view pay rolls, and add bonuses (sp?). Well, me and a few others are at work on the project. It isn't even close to complete but we're working on it rather slowly. Well, I would just like a suggestion on how to open a file, and have the text displayed in the desired area. Here, let me just show you what we have complete so far. It's sort of working, but not how it's intended to work. Here's what we have so far (BTW: the beginninins section of the code has some commented out lines, those are to write to the files and we haven't quite started on that really):

Code:
/*
Pay Roll Program
All C++ members
Work Begin:  9-18-01
	Status:  Incomplete, MENU SYSTEM AND FILE REWRITE UNDER CONSTRUCTION
*/

#include <stdio.h>	    /*needed for basic printf statement and FILE statement*/
#include <conio.h>	    /*needed for getch command to work*/
#include <iostream.h>	/*needed for cout command*/
#include <stdlib.h>		/*needed for exit(0); statement to work*/

/*Non-working section begin*/					
//void info()
//{
//	int x;
	/*Begin FILE section*/
//	FILE *mattb;
//	FILE *davec;
//	FILE *curlee;
//	FILE *timd;
//	FILE *kurte;
//	FILE *randym;
//	FILE *shawnm;
//	FILE *gennam;
//	FILE *ryanr;
//	FILE *carlosr;
//	FILE *nicks;
//	FILE *tias;
//	FILE *ronw;
//	FILE *austinw;
//	FILE *fiorella;
	/*End FILE section*/

	/*Begin file name definitions*/
//	mattb = fopen("mattb.txt","w");
//	davec = fopen("davec.txt","w");
//	curlee = fopen("curlee.txt","w");
//	timd = fopen("timd.txt","w");
//	kurte = fopen("kurte.txt","w");
//	randym = fopen("randym.txt","w");
//	shawnm = fopen("shawnm.txt","w");
//	gennam = fopen("gennam.txt","w");
//	ryanr = fopen("ryanr.txt","w");
//	carlosr = fopen("carlosr.txt","w");
//	nicks = fopen("nicks.txt","w");
//	tias = fopen("tias.txt","w");
//	ronw = fopen("ronw.txt","w");
//	austinw = fopen("austinw.txt","w");
//	fiorella = fopen("fiorella.txt","w");
	/*End file name definitions*/
/*End non-working section*/
//}

void view()
{
	int c;
	/*Begin FILE section*/
	FILE *mattb;
	FILE *davec;
	FILE *curlee;
	FILE *timd;
	FILE *kurte;
	FILE *randym;
	FILE *shawnm;
	FILE *gennam;
	FILE *ryanr;
	FILE *carlosr;
	FILE *nicks;
	FILE *tias;
	FILE *ronw;
	FILE *austinw;
	FILE *fiorella;
	/*End FILE section*/

	/*Begin file name definitions*/
	mattb = fopen("files/mattb.txt","r");
	davec = fopen("files/davec.txt","r");
	curlee = fopen("files/curlee.txt","r");
	timd = fopen("files/timd.txt","r");
	kurte = fopen("files/kurte.txt","r");
	randym = fopen("files/randym.txt","r");
	shawnm = fopen("files/shawnm.txt","r");
	gennam = fopen("files/gennam.txt","r");
	ryanr = fopen("files/ryanr.txt","r");
	carlosr = fopen("files/carlosr.txt","r");
	nicks = fopen("files/nicks.txt","r");
	tias = fopen("files/tias.txt","r");
	ronw = fopen("files/ronw.txt","r");
	austinw = fopen("files/austinw.txt","r");
	fiorella = fopen("files/fiorella.txt","r");
	/*End file name definitions*/

	system("CLS");									/*Very cool clear screen command*/
	cout << "\n\tVIEW PAY ROLL INFORMATION";
	cout << endl;
	cout << endl << "\t1.) Matt B.\t2.) Dave C.";
	cout << endl << "\t3.) Brandon C.\t4.) Tim D.";
	cout << endl << "\t5.) Kurt E.\t6.) Randy M.";
	cout << endl << "\t7.) Shawn M.\t8.) Genna M.";
	cout << endl << "\t9.) Ryan R.\t10.) Carlos R.";
	cout << endl << "\t11.) Nick S.\t12.) Tia S.";
	cout << endl << "\t13.) Ron W.\t14.) Austin W.";
	cout << endl << "\t15.) Fiorella\t16.) Exit the Pay Roll program";
	cout << endl;
	cout << endl << "\tPlease make your selection now:";
	cout << endl;
	cout << endl << "\t";
	cin >> c;

/*Start Matt B.*/
if(c == 1)
{
	if(!mattb)
	{
		cout << "\n\tTHIS FILE CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(mattb);
		putchar(c);
	}
	while(c != EOF);
	fclose(mattb);
}
/*End Matt B.*/
/*Start Dave C.*/
else if(c == 2)
{
	if(!davec)
	{
		cout << "\n\tMATT'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(davec);
		putchar(c);
	}
	while(c != EOF);
	fclose(davec);
}
/*End Dave C.*/
/*Start Curlee*/
else if(c == 3)
{
	if(!curlee)
	{
		cout << "\n\tCURLEE'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(curlee);
		putchar(c);
	}
	while(c != EOF);
	fclose(curlee);
}
/*End Curlee*/
/*Start Tim D.*/
else if(c == 4)
{
	if(!timd)
	{
		cout << "\n\tTIM'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(timd);
		putchar(c);
	}
	while(c != EOF);
	fclose(timd);
}
/*End Tim D.*/
/*Start Kurt E.*/
else if(c == 5)
{
	if(!kurte)
	{
		cout << "\n\tKURT'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(kurte);
		putchar(c);
	}
	while(c != EOF);
	fclose(kurte);
}
/*End Kurt E.*/
/*Start Randy M.*/
else if(c == 6)
{
	if(!randym);
	{
		cout << "\n\tRANDY'S PAY ROLL CANNOT BE FOUND.\n\n\t";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(randym);
		putchar(c);
	}
	while (c != EOF);
	fclose(randym);
}
/*End Randy M.*/
/*Start Shawn M.*/
else if(c == 7)
{
	if(!shawnm);
	{
		cout << "\n\tSHAWN'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(shawnm);
		putchar(c);
	}
	while (c != EOF);
	fclose(shawnm);
}
/*End Shawn M.*/
/*Start Genna M.*/
else if(c == 8)
{
	if(!gennam);
	{
		cout << "\n\tGENNA'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(gennam);
		putchar(c);
	}
	while (c != EOF);
	fclose(gennam);
}
/*End Genna M.*/
/*Start Ryan R.*/
else if(c == 9)
{
	if(!ryanr)
	{
		cout << "\n\tRYAN'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(ryanr);
		putchar(c);
	}
	while (c != EOF);
	fclose(ryanr);
}
/*End Ryan R.*/
/*Start Carlos R.*/
else if(c == 10)
{
	if(!carlosr)
	{
		cout << "\n\tCARLOS'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(carlosr);
		putchar(c);
	}
	while (c != EOF);
	fclose(carlosr);
}
/*End Carlos R.*/
/*Start Nick S*/
else if(c == 11)
{
	if(!nicks)
	{
		cout << "\n\tNICK'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(nicks);
		putchar(c);
	}
	while (c != EOF);
	fclose(nicks);
}
/*End Nick S.*/
/*Start Tia S.*/
else if(c == 12)
{
	if(!tias)
	{
		cout << "\n\tTIA'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(tias);
		putchar(c);
	}
	while (c != EOF);
	fclose(tias);
}
/*End Tia S.*/
/*Start Ron W.*/
else if(c == 13)
{
	if(!ronw)
	{
		cout << "\n\tRON'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(ronw);
		putchar(c);
	}
	while (c != EOF);
	fclose(ronw);
}
/*End Ron W.*/
/*Start Austin W.*/
else if(c == 14)
{
	if(!austinw)
	{
		cout << "\n\tAUSTIN'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(austinw);
		putchar(c);
	}
	while (c != EOF);
	fclose(austinw);
}
/*End Austin W.*/
/*Start Fiorella*/
else if(c == 15)
{
	if(!fiorella)
	{
		cout << "\n\tFIORELLA'S PAY ROLL CANNOT BE FOUND.\n\n";
		exit(0);
	}

	do				/*Start screwed up "loop"*/
	{
		c = fgetc(fiorella);
		putchar(c);
	}
	while (c != EOF);
	fclose(fiorella);
}
/*End Fiorella*/
else if(c == 16)
	exit(0);
}

void main()
{
	int menu;

	cout << "\t\tPAY ROLL PROGRAM\b";
	cout << endl << "\n\tSelect 1 to enter pay roll information";
	cout << endl << "\tSelect 2 to view pay roll information";
	cout << endl << "\tSelect 3 to exit the pay roll program";
	cout << endl;
	cout << endl << "\tPlease make your selection now:";
	cout << endl;
	cout << endl << "\t";
	cin >> menu;

//	if (menu == 1)  /*The dreaded if statement, displays function info if 1 is pressed*/
//		info();
	/*else*/ if (menu == 2)
		view();             
	else if (menu == 3)			/*Exits program when 3 is pressed*/
		exit(0);
	else if (menu == 4)
		cout << "\n\tThat is not a proper selection";
}



/*Pay Roll Setup
	1								2								3
1.) Matt B.		2.) Dave C.			<-								Thank you...
3.) Brandon C.	4.) Tim D.			<-									Goodbye
5.) Kurt E.		6.) Randy M.		<-
7.) Shawn M.	8.) Genna M.		<-
9.) Ryan R.		10.) Carlos R.		<-
11.) Nick S.	12.) Tia S.			<-
13.) Ron W.		14.) Austin W.		<-
15.) Fiorella D. 16.) Exit 			<-


  1.) MB							2.) MB
	  Wages - $15/hr					Wages - $15/hr
	  Funds - $0.00						Funds - $0.00
	  Hours - 0hrs						Hours - 0hrs
	  Press Enter to Return				Press 1 to add/subtract $
										Press 2 to add/subtract hours
										Press 3 to exit

										1.)  Enter funds to add/subtract
										2.)  Enter hours to add/subtract
*/
We're all pretty new to programming and this is sort of our first sort of serious program. Our other ones were simple phone number conversion programs and the well knowned C to F conversion program. If you like to make any other suggestions that may make things easier for us, that's cool too. Sorry if the code looks a little unusual. Hopefully someone can help us out.


--Screwz Luse