I apologize(Valmont) First of all I would like to apologize but, my teacher sprung on us today that he wants the program to do something a little bit different. I really like the way that you got the stuff even. I say truly that I appreciate all the help you are giving me (Valmont) you help me through my first class. I only have two more projects (timeDiff and phonebill) thank God and then I will be moving on to Object oriented programming
1. User enter the employee number; then that will find the employee name and the employee pay rate
so in this program we are supposed to use the "while Loop" and the if/else statements.
This is the example that he gave us:
#include <iostream>
#include <fstream>
int main
int accountNum, searchItem;
char name[30]
cout << "Enter account number:";
cin >> searchItem;
ifstream accountFile("account.lst", iso::in);
accountFile>>accountNum; //primary input
while(!accountFile.eof() searchItem! =
accountNum){
accountFile.ignore(80; '\n' );
accountFile >> accountNum; //continuing input
}//endwh
if(searchItem == accountNum){
accountFile.getline(name, sizeof(name)-1);
cout << accountNum << " " << name << endl;
{else}
cout << "Account" << searchItem <<
"not found!" << endl;
}//endif
return 0
}//endmn
Thank you very much,
D.O.C.
This is not due to Monday(12-13-04). If you have anytime I would appreciate the help. |