1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
void Customer::Add()
{
string fname;
char middle;
string lname;
string trn;
string address;
string tele;
string email;
string custid;
int d, d1, m, m1, y, y1;
bool mem;
cout<<"*********** ADD CUSTOMER ************\n"<<endl;
cout<<"Please enter the iformation requested"<<endl;
cout<<"Enter New Customer ID Number: ";
getline(cin, custid, '\n');
cin.ignore(10, '\n');
cout<<"First Name: ";
getline(cin, fname, '\n');
cin.ignore(15, '\n');
cout<<"Middle Initial: ";
cin>>middle;
cout<<"Last Name: ";
getline(cin, lname, '\n');
cin.ignore(25, '\n');
cout<<"Enter Year of Membership: ";
cin>>y;
DateofMem.setyear(y);
cout<<"TRN: ";
cin>>trn;
cout<<"Address: ";
getline(cin, address, '\n');
cin.ignore(500, '\n');
cout<<"Telephone Number: ";
getline(cin, tele, '\n');
cin.ignore(15, '\n');
cout<<"Email Address: ";
getline(cin, email, '\n');
cin.ignore(50, '\n');
ofstream outCustomerFile;
outCustomerFile.open("Customer.txt", ios::out);
if( !outCustomerFile)
{
cerr<<"File could not be opened"<<endl;
exit(1);
}
//Customer::setMember(true);
outCustomerFile<<"Customer Id Number: "<<custid<<endl;
outCustomerFile<<"First Name: "<<fname<<endl;
outCustomerFile<<"Middle Name: "<<middle<<endl;
outCustomerFile<<"Last Name: "<<lname<<endl;
outCustomerFile<<"TRN Number: "<<trn<<endl;
outCustomerFile<<"Address: "<<address<<endl;
outCustomerFile<<"Telephone: "<<tele<<endl;
outCustomerFile<<"Email Address: "<<email<<endl;
}
|