c++ programming error ^_^

princeoo7

On a Journey called Life :P
Skilled
Hey guys was trying some of the Programs from book and understanding and so just started with the program

below is the link :)

banking app.cpp

I did tried to solve errors but I fail :(

please help me out with this ;)

program is incomplete but the stages are complete mean i have complete the phase as per in the reference book.

I am using Borland 5.2 in windows 7 :)

plz also share how did you solved the error ;)

thank you for reading :clap:
 
Dude are you sure this is the whole code?there's no main() function.And there are a few semicolons missing too.Is this your own code? ;)

Either way you should atleast get it to run and post it again when you get a proper error.we'll help you out then. :)
Code:
#include<iostream.h>

#include<fstream.h>

#include<process.h>

#include<string.h>

#include<stdlib.h>

#include<stdio.h>

#include<ctype.h>

#include<conio.h>

#include<dos.h>

#include<iomanip.h>

class Menus

{

public :

				void showmenu(void) ;

private :

				void closemenu(void) ;

};

class disRecords

{

public :

				void addDeatails(int,char name[50],char address[100],float);

            void displaycustomers(void);

            void deleteAccount(int);

            void updateBalance(int,float);

            void updateCustomer(void);

            int lastAccount(void);

            int accountExists(int);

            char *getName(int);

            char *getAddress(int);

            float getBalance(int);

            int getRecord(int);

            void display(int);

            void displaylist(int);

            int Accountnumber;

            char name[50], address[50];

            float intBalance;

};

class accountTransactions

{

public :

				void new_account(void);

            void closeAccount(void);

            void display_account(void);

            void transaction(void);

            void addDetails(int,int,int,int,char,char typeTransaction[15],float,float,float);

            void deleteAccount(int);

            int dateDiffer(int,int,int,int,int,int);

            float getInterest(int, float);

            void display(int);

            void showAccount(int);

            int AccountNumber;

            char trantype[10];

            int dday,mmont,yyear;

            char transactions;

            float intInterest, intamount, intBalance;

            static float calcInterest;

            void showInterest(void);

};

void Menus	::	 showmenu(void)

{

char choice;

while(1)

{

				clrscr();

            cout<<"	\n ------- Welcome to Banking System Application ------- \n";

            cout<<"********************************************** \n 		  \n";

            cout<<" Choose form the Option 											  \n";

            cout<<" ___________________________________							  \n";

            cout<<"			1:Open an New Account 							 		  \n";

            cout<<"			2:View an Account 										  \n";

            cout<<"			3:Show all Accounts 										  \n";

            cout<<"			4:Make a Transaction										  \n";

            cout<<"			5:Calculate Intreset										  \n";

            cout<<"			6:Close an Account 										  \n";

            cout<<"			7:Exit \n			 										  \n";

            cout<<"		  Pleas Select A choice :  			  					  \n";

            choice = getche();

            	if (choice == '1')

               {

               			accountTransactions objAT;

                        objAT.new_account();

               }

               else

               if	(choice == '2')

               {

               			accountTransactions objAT;

                        objAT.display_account();

               }

               else

               if	(choice == '3')

               {

               			dispRecords newRec;

                        newRec.displayCustomers();

               }

               else

               if	(choice == '4')

               {               }

                        int record ;

                        record = getRecord(retrieve_AccNo) ;

                        fstream filename ;

                        filename.open("newrecords.dat",ios::in);

                        file.seekg(0,ios::end);

                        int location;

                        location = (record) = sizeof(dispRecords);

                        filename.seekp(loaction);

                        while (filename.read((char*) this, sizeof(dispRecords))

                        {

                        if (retrieve_AccNo == AccountNumber)

                        {

                        		cout<<"\n ACCOUNT NO. 	:"<<Accountnumber;

                              cout<<"\n Name          :"<<name;

                              cout<<"\n Address			:"<<address;

                              cout<<"\n Balance			:"<<intBalance;

                              break;

                        }

               }

      filename.close();

      }

char	*dispRecords	::	getName(int retrieve_AccNo)

{

	fstream filename;

   filename.open(*newrecords.dat", ios::int);

   filename.seekg(0,ios::beg);

   char retrieve_CustName[50];

   			while (filename.read((char*) this, sizeof(dispRecords)))

            {

            			if (AccountNumber == retrieve_Accno)

                     {

                     	strcpy(retrieve_CustName,name);

                     }

            }

            filename.close()l

            return retrieve_CustName;

   }

   char*dispRecords :: getAddress (intRetrieve_AccNo)

   {

   	fstream filename;

      filename.open("newrecords.dat", ios::in);

      filename.seekg(0,ios::beg);

      char retrieve_Address[100];

      while (filename.read((char*)this, sizeof(dispRecords)))

      {

      			id (AccountNumer == retrieve_Accno)

               {

               			strcpy(retrieve_Address,address);

               }

      }

      filename.close();

      return retrieve_Address;

	}

   float dispRecords :: getBalance(int retrieve_AccNo)

   {

   	fstream filename;

      filename.open("newrecords.dat",ios::in);

      filename.seekg(0,ios::beg);

      float iBalance;

      while (filename.read((char*) this, sizeof(dispRecords)))

      {

      			if (AccountNumber == retrieve_AccNo)

               {

               	iBalance = intBalance;

               }

      }

      filename.close();

      return ibalance ;

   }

   int dispReecords :: accountExists(int, Retrieve_AccNo)

   {

   	stream filename;

      filename.open("newrecords.dat", ios::in);

      filename.seekg(0;ios::beg);

      int count=0;

      while(filename.read((char*) this, sizeof(dispRecords)))

      {

      			if (AccountNumber == retrieve_AccNo)

               {

               			count = 1;

                        break;

               }

      }

      filename.close();

      return count;

   }

   void dispRecords :: displayList()

   {

   	cout<<"

      int day1,mont1,year1		;

      struct date dateval		;

      getdate(&dateval)			;

      day1 = dateval.da_day	;

      month1 = dateval.da_mon	;

      year1 = dateval.da_year	;

      cout<<" \n Date : " <<day1 <<"/" <<month1 <<"/" <<year1<<"\n";

      cout<<setw(80)<<"__________________________________________\n";

      cout<<setw(23)<<" ACCOUNT NO. ";

      cout<<setw(23)<<"NAME OF PERSON";

      count<<setw(23)<<"BALANCE \n";

      cout<<setw(23)<<"_______________________________________\n";

   }

   void dispRecords :: displaycustomers (void)

   {

   	clrscr()

      int lenl;

      int row=8, check;

      fstream filename;

      FILE = pFile;

      pFile = fopen("newrecords.dat","r");

      if (pFile == NULL)

      {

      	cout<<"\n No Account Exists. Please go back to the previous menu. \n";

         	getch();

            return;

            //fclose (pFile);

            }

            else

            {

            displayList():

            filename.open("newrecords.dat",ios::in);

            filename.seekg(0,ios::beg);

            while(filename.read((char*) this, sizeof(dispRecords)))

            {

            			check = 0 ;

                     cout.fill (' ');

                     cout <<setw(20);

                     cout.setf(ios::right, ios::adjustfield);

                     cout<<AccountNumber;

                     cout.fill (' ');

                     cout <<setw(25);

                     cout.self(ios::internal, ios::adjustfield);

                     cout<<name;

                     cout<<setw(23);

                     cout.setf(ios::right,ios::adjustfield);

                     cout<<intBalance<<"\n";

                     row++;

                     if (row == 23)

                     {

                     			check =1 ;

                              row = 8 ;

                              cout<<" \n\n Continue the Application ....... \n";

                              getch();

                              clrscr();

                              dispList();

                     }

            }

         }

         filename.close();

         if (!check)

         {

         			cout<<"\n\n Continue the Application....... \n";

                  getch();

         }

      }

      void dispRecords :: addDetails (int retrieve_AccNo, char retrieve_CustNmae[30],char retrieve_Address[60], float iBalance)

      {

      	AccountNumber = retrieve_AccNo;

         strcpy(nsme,retrieve_CustName);

         strcpy(address,retrieve_Address);

         intBalance = iBalance;

         fstream filename;

         filename.open("newrecords.dat", ios::out | ios::app);

         filename.write((char*) this, sizeof(dispRecords));

         filename.close();

      }

      void dispRecords :: deleteAccount(int retrieve_AccNo)

      {

      	fstream.open("newrecords.dat", ios::in);

         fstream temp;

         temp.open("calculation.txt", ios::out);

         filename.seekg(0,ios::beg);

         while (filename.eof())

         {

         			filename.read((char*) this, sizeof(disprecords));

                  if (filename.eof())

                  			break;

                  if (AccountNumber !=retrieve_AccNo)

                  			temp.write((char*) this, size(dispRecords));

         }

         filename.close();

         temp.close();

         filename.open("newrecords.dat", ios::out);

         temp.open("calculations.txt", ios::in);

         temp.seekg(0,ios::beg);

         while ( !temp.eof())

         {

         			temp.read((char*) this, sizeof(dispRecords));

                  if (temp.eof())

                  			break;

                  filename.write((char*) this, sizeof(dispRecords));

         }

         filename.close();

         temp.close();

      }

      void dispRecords :: updateBalance(int retrieve_AccNo, float iBalance)

      {

      	int record ;

         record = getRecord(retrieve_AccNo);

         fstream filename;

         filename.open("newrecords.dat", ios::out| ios::ate);

         intBalance = iBalance;

         int location;

         location = (record-1)* sizeof(dispRecords);

         filename.seekg(loaction);

         filename.write((char*) this, sizeof(dispRecords));

         filename.close();

      }

		void accountTransactions :: addDetails(int retrieve_AccNo, int dey1, int month1, iht year1, char t_tran, char typeTransaction[10], float interest_accrued, float t_amount, float iBalance)

      {

      	fstream filename;

         filename.open("transactions.dat", ios::app) ;

         AccountNumber = retrieve_AccNo;

         dday = day1;

         mmonth1 = month1;

         yyear1 = year1;

         transaction = t_tran;

         strcpy(trantype,typeTransaction);

         intInterest = interest_accrued;

         intAmount = t_amount;

         intBalance = iBalance;

         filename.write((char*) this, sizeof(accountTransactions));

         filename.close();

      }

      void accountTrancastions :: deleteAccount(int retrieve_AccNo)

      {

      	fstream filename;

         filename.open("transactions.dat", ios::in);

         fstream temp;

         temp.open("calculations.txt" , ios::out);

         filename.seekg(0,ios::beg);

         while ( !filename.eof())

         {

         			filename.read((char*) this, sizeof(accountTransactions));

                  if (filename.eof())

                  			break;

                  if ( AccountNumber != retrieve_AccNo)

                  			temp.write((char*) this, sizeof(accountTransactions));

         }

         filename.close();

         temp.close();

         filename.open("transactions.dat", ios::out);

         temp.open("calculations.txt, ios::in);

         temp.seekg(0, ios::beg);

         while ( ! temp.eof())

         {

         			temp.read((char*) this, sizeof(accountTransactions));

                  if (temp.eof())

                  			break;

                  filename.write((char*) this, sizeof(accountTransactions));

         }

         filename.close();

         temp.close();

      }

      void accountTrancastion :: new_account(void)

      {

      	char choice;

         inti, check;

         clrscr();

         dispRecords newRec ;

         cout<<"			Please press 0 to go back to previous menu. \n";

         cout<<"							\n";

         cout<<"			---Open a New Bank Account---   \n";

         cout<<"				***********************      \n";

         int day1,month1,year1;

         struch date dateval;

         getdate(&dateval);

         day1 = dateval.da_day;

         month1 = dateval.da_mon;

         year1 = dateval.da_year;

         int retrieve_AccNo;

         retrieve_AccNo = newRec.lastAccount();

         retrieve_AccNo++ ;

         if (retrieve_AccNo  == 1)

         {

         			newRec.addDetails(retrieve_AccNo,"ravi","Delhi",1.1);

                  newRec.deleteAccount(retrieve_AccNo);

                  addDetails(retrieve_AccNo,1,1,1997,'D',"default value",1.1,1.1,1.1);

                  deleteAccount(retrieve_AccNo);

         }

         xhar retrieve_CustName[30], tran_acc[10], retrieve_Address[60];

         float t_bal, iBalance;

         cout<<" Date: "<<day1<<"/"<<month1<<"/"<<year1<<"\n";

         cout<<" Accout No. # "retrieve_AccNo;

         do

         {

         			cout<<"\n\n   Please Enter the Name of the Account Holder : ";

                  check = 1;

                  gets(retrieve_CustName);

                  if (retrieve_CustName[0] == '0' )

                  {

                  		coout<<" \n\t			Invalid Customer Name.";

                        getch();

                        returen;

                  }

                  strupr(retrieve_CustName);

                  if (strlen(retrieve_CustName) == 0 || strlen(retrieve_CustName) > 30 )

                  {

                  			check = 0;

                           cout<<"\t\n Customer Name is either Blank ot it's lenght is greater than 30 characters. \n";

                           getch();

                  }

         } while (!check);

         do

         {

         			cou<<"\n				Please Enter the Account Holder's Address : ";

                  check = 1;

                  gets(retrieve_Address);

                  if (retrieve_Address[0] == '0')

                  {

                  			cout<<"\n\t       Invalid Customer Address.";

                           getch();

                           return;

                  }

                  strupr(retrieve_Address);

                  if (strlen(retrieve_Address) < 1 || strlen(retrieve_Address) > 60)

                  {

                  			check = 0;

                           cout<<"\t\n			Customer Address is Either Blank or its length is greater than 60 characters.\n";

                           getch();

                  }

         }while (!check);

         do

         {

         			char chrVerfiyingPerson[30];

                  cout<<"\n Please Enter the name of the Verifying Person of the Account Holder: ";

                  check = 1;

                  gets(chr_VerfiyingPerson);

                  if (char_VerifyingPerson[0] == '0')

                  {

                  			cout<<"\n\t 		Invalid Verfiying Perosn Name. ";

                           getch();

                           return;

                  }

                  strupr(chr_VerifyingPerson);

                  if (strlen(chr_VerifyingPerson) < 1 || strlen(chr_VerifyingPerson) > 30)

                  {

                  			check = 0;

                           cout<<"\t\n The verifying Person's Name is either blank or greater than 30 characters. Please try again. \n ";

                           getch();

                  }

         }while (!check);

         do

         {

         			cout<<"\n Please Enter the Deposit Amount while opening a New Account :";

                  check = 1 ;

                  gets(tran_acc);

                  iBalance = t_bal;

                  if (strlen(tran_acc) < 1 ) {

                  			cout<<"\n Invalid Transaction value. Exiting from the current Menu. \n";

                  			getch();

                  			return;

                  }

                  if (iBalance < 1000 )

                  {

                  			check = 0 ;

                           cout<<"\t\n The Minimum Amount Should be Rs. 1000. Please try again. \n ";

                           getch();

                  	}

                  } while (!check) ;

                  do

                  {

                  			cout <<"\n    Do you want to save the record ? (y/n) : ";

                           choice = getch();

                           choice = toupper(choice);

                  } while (choice != 'N' && choice != 'Y');

                  if (choice  == 'N' || choice =='n')

                  {

                  			cout<<" \n The Customer Account is not created \n. Please continue wiht the application. \n";

                           getch();

                           return;

         }

         float t_amount, interest_accrued ;

         t_amount = iBalance ;

         interest_accrued = 0.0 ;

         char t_tran, typeTransaction[10] ;

         t_tran = 'D' ;

         strcpy(typeTransaction," ");

         newRec.addDetails(retrieve_AccNo,retrieve_CustName,retrieve_Address,iBalance) ;

         addDetails(retrieve_AccNo,day1,month1,year1,t_tran,typeTransaction,interest_accrued,t_amount,iBalance);

         cout<<"\n\n					The New Account is Successe\fully Created. \n

         Please continue with this application. \n";

         getch();

         }

         void accountTransactions :: showAccount(int retrieve_AccNo)

         {

         			cout<<"

                  														\n"

                  int day1,month1,year1 ;

                  struct date dateval;

                  getdate(&dateval);

                  day1 = dateval.da_day ;

                  month1 = dateval.da_mon;

                  year1 = dateval.da_year;

                  cout <<" Date : " <<day1 <<"/" << month1 <<"/" << year1 <<"\n" ;

                  cout <<"Account No. " <<retrieve_AccNo ;

                  dispRecords newRec ;

         			char retrieve_CustName[30] ;

                  strcpy(retrieve_CustName,newRec.getAddress(retrieve_AccNo)) ;

                  char retrieve_Address[60]	;

                  strcpy(retrieve_Address,newRec.getAddress(retrieve_AccNo))	;

                  cout<<setw(25)<<"\n Account Holder's Name : "<<retrieve_CustName;

                  cout<<"\Address			 : 		"<<retrieve_Address<<"\n";

                  cout<<setw(80)<<"\n ____________________________________ \n";

                  cout<<setw(10)<<"Dated";

                  cout<<setw(12)<<"Details";

                  cout<<setw(12)<<"Deposited";

                  cout<<setw(15)<<"Withdrawn";

                  cout<<setw(12)<<"				";

                  cout<<setw(10)<<"Balance";

                  cout<<setw(80)<<"\n ____________________________________ \n";

         }

         void accountTransactions :: display_account(void)

         {

         			clrscr();

                  char t_acc[10];

                  int tran_acc, retrieve_AccNo;

                  dispRecords obj2;

                  cout<<" 			Press 0 to go to the previous menu. \n";

                  cout<<" 			Please Enter the Account No. you want to view : " ;

                  gets(t_acc);

                  tran_acc = atoi(t_acc);

                  retireve_AccNo = tran_acc;

                  if (retrieve_AccNo ==  0) {

                  cout<<"\n			You Have Pressed 0 to exit. \n";

                  getch();

                  return;

         }
 
Sorry guy's :( i found that there was a paragraph missing and after adding it most of the error got solved but some of them still exists :(

plz have a look at it :)

Code:
#include<iostream.h>

#include<fstream.h>

#include<process.h>

#include<string.h>

#include<stdlib.h>

#include<stdio.h>

#include<ctype.h>

#include<conio.h>

#include<dos.h>

#include<iomanip.h>

class Menus

{

public :

				void showmenu(void) ;

private :

				void closemenu(void) ;

};

class disRecords

{

public :

				void addDeatails(int,char name[50],char address[100],float);

            void displaycustomers(void);

            void deleteAccount(int);

            void updateBalance(int,float);

            void updateCustomer(void);

            int lastAccount(void);

            int accountExists(int);

            char *getName(int);

            char *getAddress(int);

            float getBalance(int);

            int getRecord(int);

            void display(int);

            void displaylist(int);

            int Accountnumber;

            char name[50], address[50];

            float intBalance;

};

class accountTransactions

{

public :

				void new_account(void);

            void closeAccount(void);

            void display_account(void);

            void transaction(void);

            void addDetails(int,int,int,int,char,char typeTransaction[15],float,float,float);

            void deleteAccount(int);

            int dateDiffer(int,int,int,int,int,int);

            float getInterest(int, float);

            void display(int);

            void showAccount(int);

            int AccountNumber;

            char trantype[10];

            int dday,mmont,yyear;

            char transactions;

            float intInterest, intamount, intBalance;

            static float calcInterest;

            void showInterest(void);

};

void Menus	::	 showmenu(void)

{

char choice;

while(1)

{

				clrscr();

            cout<<" \n ------- Welcome to Banking System Application ------- \n";

            cout<<"********************************************** \n 		  \n";

            cout<<" Choose form the Option 											  \n";

            cout<<" ___________________________________							  \n";

            cout<<"			1:Open an New Account 							 		  \n";

            cout<<"			2:View an Account 										  \n";

            cout<<"			3:Show all Accounts 										  \n";

            cout<<"			4:Make a Transaction										  \n";

            cout<<"			5:Calculate Intreset										  \n";

            cout<<"			6:Close an Account 										  \n";

            cout<<"			7:Exit \n			 										  \n";

            cout<<"		  Pleas Select A choice :  			  					  \n";

            choice = getche();

            	if (choice == '1')

               {

               			accountTransactions objAT;

                        objAT.new_account();

               }                            

               else

               if	(choice == '2')

               {

               			accountTransactions objAT;

                        objAT.display_account();

               }

               else

               if	(choice == '3')

               {

               			dispRecords newRec;

                        newRec.displayCustomers();

               }

               else

               if	(choice == '4')

               {

               			accountTransactions objAT;

                        objAT.transaction();

               }

               else

               if (choice == '5')

               {

               			accountTransactions objAT;

                        objAT.showInterest();

               }

               else

               if (choice == '6') {

               			closemenu();

               }

               else

               if (choice == '7')

               {

               cout<<" \n    Thanks for using this application . Please press any key to exit. \n ";

               getch();

               break;

               }

            }

	}

   void Menus :: closemenu(void)

	{

   char choice;

   while (1)

   {

   			clrscr();

            cout<<"			---Close Menu---			\n";

            cout<<"		****************************** \n";

            cout<<"		1:	Close/Delete an Account 	\n";

            cout<<"		0: Exit from this menu.	\n\n";

            cout<<"		Select a Choice : ";

            choice = getche();

            			if (choice == '1')

                     {

                     			accountTransactions at ;

                              at.closeAccount();

                              break;

                     }

                     else

                     if (choice == '0')

                     {

                     cout<<" \n		You have Entered 0 to go back to the previeous Menu. \n";

                     getch();

                     break;

            }

   		}

		}

      int dispRecords :: lastAccount(void)

      {

      			fstream filename ;

               filename.open("newrecords.dat", ios::in) ;

               filename.seekg(0, ios::beg) ;

               int count=0 ;

               while (filename.read((char *) this, sizeof(dispRecords))) count = AccountNumber ;

               filename.close();

               return count;

      		}

            int dispRecords   ::   getRecords(int retrieve_AccNo)

            {

            			fstream filename;

                     filename.open("newrecords.dat",   ios::in);

                     filename.seekg(0, ios::beg);

                     int count = 0;

                     while (filename.read((char*) this, sizeof(dispRecords)))

                     {

                     			count++;

                              if (retriev_AccNo == AccoutnNumber)

                              break;

                     }

                     filename.close();

                     return count;

            }

            void dispRecords :: display(int retrieve_AccNo)

               {

                        int record ;

                        record = getRecord(retrieve_AccNo) ;

                        fstream filename ;

                        filename.open("newrecords.dat",ios::in);

                        file.seekg(0,ios::end);

                        int location;

                        location = (record) = sizeof(dispRecords);

                        filename.seekp(loaction);

                        while (filename.read((char*) this, sizeof(dispRecords))

                        {

                        if (retrieve_AccNo == AccountNumber)

                        {

                        		cout<<"\n ACCOUNT NO. 	:"<<Accountnumber;

                              cout<<"\n Name          :"<<name;

                              cout<<"\n Address			:"<<address;

                              cout<<"\n Balance			:"<<intBalance;

                              break;

                        }

               }

      filename.close();

      }

char	*dispRecords	::	getName(int retrieve_AccNo)

{

	fstream filename;

   filename.open("newrecords.dat", ios::int);

   filename.seekg(0,ios::beg);

   char retrieve_CustName[50];

   			while (filename.read((char*) this, sizeof(dispRecords)))

            {

            			if (AccountNumber == retrieve_Accno)

                     {

                     	strcpy(retrieve_CustName,name);

                     }

            }

            filename.close()l

            return retrieve_CustName;

   }

   char*dispRecords :: getAddress (intRetrieve_AccNo)

   {

   	fstream filename;

      filename.open("newrecords.dat", ios::in);

      filename.seekg(0,ios::beg);

      char retrieve_Address[100];

      while (filename.read((char*)this, sizeof(dispRecords)))

      {

      			id (AccountNumer == retrieve_Accno)

               {

               			strcpy(retrieve_Address,address);

               }

      }

      filename.close();

      return retrieve_Address;

	}

   float dispRecords :: getBalance(int retrieve_AccNo)

   {

   	fstream filename;

      filename.open("newrecords.dat",ios::in);

      filename.seekg(0,ios::beg);

      float iBalance;

      while (filename.read((char*) this, sizeof(dispRecords)))

      {

      			if (AccountNumber == retrieve_AccNo)

               {

               	iBalance = intBalance;

               }

      }

      filename.close();

      return ibalance ;

   }

   int dispReecords :: accountExists(int, Retrieve_AccNo)

   {

   	stream filename;

      filename.open("newrecords.dat", ios::in);

      filename.seekg(0;ios::beg);

      int count=0;

      while(filename.read((char*) this, sizeof(dispRecords)))

      {

      			if (AccountNumber == retrieve_AccNo)

               {

               			count = 1;

                        break;

               }

      }

      filename.close();

      return count;

   }

   void dispRecords :: displayList()

   {

   	cout<<" \n " ;

      int day1,mont1,year1		;

      struct date dateval		;

      getdate(&dateval)			;

      day1 = dateval.da_day	;

      month1 = dateval.da_mon	;

      year1 = dateval.da_year	;

      cout<<" \n Date : " <<day1 <<"/" <<month1 <<"/" <<year1<<"\n";

      cout<<setw(80)<<"__________________________________________\n";

      cout<<setw(23)<<" ACCOUNT NO. ";

      cout<<setw(23)<<"NAME OF PERSON";

      count<<setw(23)<<"BALANCE \n";

      cout<<setw(23)<<"_______________________________________\n";

   }

   void dispRecords :: displaycustomers (void)

   {

   	clrscr()

      int lenl;

      int row=8, check;

      fstream filename;

      FILE = pFile;

      pFile = fopen("newrecords.dat","r");

      if (pFile == NULL)

      {

      	cout<<"\n No Account Exists. Please go back to the previous menu. \n";

         	getch();

            return;

            //fclose (pFile);

            }

            else

            {

            displayList():

            filename.open("newrecords.dat",ios::in);

            filename.seekg(0,ios::beg);

            while(filename.read((char*) this, sizeof(dispRecords)))

            {

            			check = 0 ;

                     cout.fill (' ');

                     cout <<setw(20);

                     cout.setf(ios::right, ios::adjustfield);

                     cout<<AccountNumber;

                     cout.fill (' ');

                     cout <<setw(25);

                     cout.self(ios::internal, ios::adjustfield);

                     cout<<name;

                     cout<<setw(23);

                     cout.setf(ios::right,ios::adjustfield);

                     cout<<intBalance<<"\n";

                     row++;

                     if (row == 23)

                     {

                     			check =1 ;

                              row = 8 ;

                              cout<<" \n\n Continue the Application ....... \n";

                              getch();

                              clrscr();

                              dispList();

                     }

            }

         }

         filename.close();

         if (!check)

         {

         			cout<<"\n\n Continue the Application....... \n";

                  getch();

         }

      }

      void dispRecords :: addDetails (int retrieve_AccNo, char retrieve_CustNmae[30],char retrieve_Address[60], float iBalance)

      {

      	AccountNumber = retrieve_AccNo;

         strcpy(nsme,retrieve_CustName);

         strcpy(address,retrieve_Address);

         intBalance = iBalance;

         fstream filename;

         filename.open("newrecords.dat", ios::out | ios::app);

         filename.write((char*) this, sizeof(dispRecords));

         filename.close();

      }

      void dispRecords :: deleteAccount(int retrieve_AccNo)

      {

      	fstream.open("newrecords.dat", ios::in);

         fstream temp;

         temp.open("calculation.txt", ios::out);

         filename.seekg(0,ios::beg);

         while (filename.eof())

         {

         			filename.read((char*) this, sizeof(disprecords));

                  if (filename.eof())

                  			break;

                  if (AccountNumber !=retrieve_AccNo)

                  			temp.write((char*) this, size(dispRecords));

         }

         filename.close();

         temp.close();

         filename.open("newrecords.dat", ios::out);

         temp.open("calculations.txt", ios::in);

         temp.seekg(0,ios::beg);

         while ( !temp.eof())

         {

         			temp.read((char*) this, sizeof(dispRecords));

                  if (temp.eof())

                  			break;

                  filename.write((char*) this, sizeof(dispRecords));

         }

         filename.close();

         temp.close();

      }

      void dispRecords :: updateBalance(int retrieve_AccNo, float iBalance)

      {

      	int record ;

         record = getRecord(retrieve_AccNo);

         fstream filename;

         filename.open("newrecords.dat", ios::out| ios::ate);

         intBalance = iBalance;

         int location;

         location = (record-1)* sizeof(dispRecords);

         filename.seekg(loaction);

         filename.write((char*) this, sizeof(dispRecords));

         filename.close();

      }

		void accountTransactions :: addDetails(int retrieve_AccNo, int dey1, int month1, iht year1, char t_tran, char typeTransaction[10], float interest_accrued, float t_amount, float iBalance)

      {

      	fstream filename;

         filename.open("transactions.dat", ios::app) ;

         AccountNumber = retrieve_AccNo;

         dday = day1;

         mmonth1 = month1;

         yyear1 = year1;

         transaction = t_tran;

         strcpy(trantype,typeTransaction);

         intInterest = interest_accrued;

         intAmount = t_amount;

         intBalance = iBalance;

         filename.write((char*) this, sizeof(accountTransactions));

         filename.close();

      }

      void accountTrancastions :: deleteAccount(int retrieve_AccNo)

      {

      	fstream filename;

         filename.open("transactions.dat", ios::in);

         fstream temp;

         temp.open("calculations.txt" , ios::out);

         filename.seekg(0,ios::beg);

         while ( !filename.eof())

         {

         			filename.read((char*) this, sizeof(accountTransactions));

                  if (filename.eof())

                  			break;

                  if ( AccountNumber != retrieve_AccNo)

                  			temp.write((char*) this, sizeof(accountTransactions));

         }

         filename.close();

         temp.close();

         filename.open("transactions.dat", ios::out);

         temp.open("calculations.txt", ios::in);

         temp.seekg(0, ios::beg);

         while ( ! temp.eof())

         {

         			temp.read((char*) this, sizeof(accountTransactions));

                  if (temp.eof())

                  			break;

                  filename.write((char*) this, sizeof(accountTransactions));

         }

         filename.close();

         temp.close();

      }

      void accountTrancastion :: new_account(void)

      {

      	char choice;

         inti, check;

         clrscr();

         dispRecords newRec ;

         cout<<"			Please press 0 to go back to previous menu. \n";

         cout<<"							\n";

         cout<<"			---Open a New Bank Account---   \n";

         cout<<"				***********************      \n";

         int day1,month1,year1;

         struch date dateval;

         getdate(&dateval);

         day1 = dateval.da_day;

         month1 = dateval.da_mon;

         year1 = dateval.da_year;

         int retrieve_AccNo;

         retrieve_AccNo = newRec.lastAccount();

         retrieve_AccNo++ ;

         if (retrieve_AccNo  == 1)

         {

         			newRec.addDetails(retrieve_AccNo,"ravi","Delhi",1.1);

                  newRec.deleteAccount(retrieve_AccNo);

                  addDetails(retrieve_AccNo,1,1,1997,'D',"default value",1.1,1.1,1.1);

                  deleteAccount(retrieve_AccNo);

         }

         xhar retrieve_CustName[30], tran_acc[10], retrieve_Address[60];

         float t_bal, iBalance;

         cout<<" Date: "<<day1<<"/"<<month1<<"/"<<year1<<"\n";

         cout<<" Accout No. # "retrieve_AccNo;

         do

         {

         			cout<<"\n\n   Please Enter the Name of the Account Holder : ";

                  check = 1;

                  gets(retrieve_CustName);

                  if (retrieve_CustName[0] == '0' )

                  {

                  		coout<<" \n\t			Invalid Customer Name.";

                        getch();

                        returen;

                  }

                  strupr(retrieve_CustName);

                  if (strlen(retrieve_CustName) == 0 || strlen(retrieve_CustName) > 30 )

                  {

                  			check = 0;

                           cout<<"\t\n Customer Name is either Blank ot it's lenght is greater than 30 characters. \n";

                           getch();

                  }

         } while (!check);

         do

         {

         			cou<<"\n				Please Enter the Account Holder's Address : ";

                  check = 1;

                  gets(retrieve_Address);

                  if (retrieve_Address[0] == '0')

                  {

                  			cout<<"\n\t       Invalid Customer Address.";

                           getch();

                           return;

                  }

                  strupr(retrieve_Address);

                  if (strlen(retrieve_Address) < 1 || strlen(retrieve_Address) > 60)

                  {

                  			check = 0;

                           cout<<"\t\n			Customer Address is Either Blank or its length is greater than 60 characters.\n";

                           getch();

                  }

         }while (!check);

         do

         {

         			char chrVerfiyingPerson[30];

                  cout<<"\n Please Enter the name of the Verifying Person of the Account Holder: ";

                  check = 1;

                  gets(chr_VerfiyingPerson);

                  if (char_VerifyingPerson[0] == '0')

                  {

                  			cout<<"\n\t 		Invalid Verfiying Perosn Name. ";

                           getch();

                           return;

                  }

                  strupr(chr_VerifyingPerson);

                  if (strlen(chr_VerifyingPerson) < 1 || strlen(chr_VerifyingPerson) > 30)

                  {

                  			check = 0;

                           cout<<"\t\n The verifying Person's Name is either blank or greater than 30 characters. Please try again. \n ";

                           getch();

                  }

         }while (!check);

         do

         {

         			cout<<"\n Please Enter the Deposit Amount while opening a New Account :";

                  check = 1 ;

                  gets(tran_acc);

                  iBalance = t_bal;

                  if (strlen(tran_acc) < 1 ) {

                  			cout<<"\n Invalid Transaction value. Exiting from the current Menu. \n";

                  			getch();

                  			return;

                  }

                  if (iBalance < 1000 )

                  {

                  			check = 0 ;

                           cout<<"\t\n The Minimum Amount Should be Rs. 1000. Please try again. \n ";

                           getch();

                  	}

                  } while (!check) ;

                  do

                  {

                  			cout <<"\n    Do you want to save the record ? (y/n) : ";

                           choice = getch();

                           choice = toupper(choice);

                  } while (choice != 'N' && choice != 'Y');

                  if (choice  == 'N' || choice =='n')

                  {

                  			cout<<" \n The Customer Account is not created \n. Please continue wiht the application. \n";

                           getch();

                           return;

         }

         float t_amount, interest_accrued ;

         t_amount = iBalance ;

         interest_accrued = 0.0 ;

         char t_tran, typeTransaction[10] ;

         t_tran = 'D' ;

         strcpy(typeTransaction," ");

         newRec.addDetails(retrieve_AccNo,retrieve_CustName,retrieve_Address,iBalance) ;

         addDetails(retrieve_AccNo,day1,month1,year1,t_tran,typeTransaction,interest_accrued,t_amount,iBalance);

         cout<<"\n\n					The New Account is Successe\fully Created. \n Please continue with this application. \n";

         getch();

         }

         void accountTransactions :: showAccount(int retrieve_AccNo)

         {

         			cout<<"\n"

                  int day1,month1,year1 ;

                  struct date dateval;

                  getdate(&dateval);

                  day1 = dateval.da_day ;

                  month1 = dateval.da_mon;

                  year1 = dateval.da_year;

                  cout <<" Date : " <<day1 <<"/" << month1 <<"/" << year1 <<"\n" ;

                  cout <<"Account No. " <<retrieve_AccNo ;

                  dispRecords newRec ;

         			char retrieve_CustName[30] ;

                  strcpy(retrieve_CustName,newRec.getAddress(retrieve_AccNo)) ;

                  char retrieve_Address[60]	;

                  strcpy(retrieve_Address,newRec.getAddress(retrieve_AccNo))	;

                  cout<<setw(25)<<"\n Account Holder's Name : "<<retrieve_CustName;

                  cout<<"\Address			 : 		"<<retrieve_Address<<"\n";

                  cout<<setw(80)<<"\n ____________________________________ \n";

                  cout<<setw(10)<<"Dated";

                  cout<<setw(12)<<"Details";

                  cout<<setw(12)<<"Deposited";

                  cout<<setw(15)<<"Withdrawn";

                  cout<<setw(12)<<"				";

                  cout<<setw(10)<<"Balance";

                  cout<<setw(80)<<"\n ____________________________________ \n";

         }

         void accountTransactions :: display_account(void)

         {

         			clrscr();

                  char t_acc[10];

                  int tran_acc, retrieve_AccNo;

                  dispRecords obj2;

                  cout<<" 			Press 0 to go to the previous menu. \n";

                  cout<<" 			Please Enter the Account No. you want to view : " ;

                  gets(t_acc);

                  tran_acc = atoi(t_acc);

                  retireve_AccNo = tran_acc;

                  if (retrieve_AccNo ==  0) {

                  cout<<"\n			You Have Pressed 0 to exit. \n";

                  getch();

                  return;

         }

line :

07,21

103,37

103,37

104,32

143,21

162,22

162,22

have the error :)
 
Dont have borland, but

class disRecords

Should be

class dispRecords

perhaps??

It explains

103,37
104,32
162,22
EDIT:Rest of the issues seem to be with ctype.h

make a separate demo program and see if functions from it are working or not...

--- Updated Post - Automerged ---

I'm slightly confused, issue could be with conio.h as well. Check that as well (and please avoid using it whenever possible. its a bad habit)
 
If you are copying this from a reference book then you need to take some typing classes or that book itself has the coding absolutely wrong.

There are soooo many spelling mistakes that I think you are very bad at typing. Then come the programming errors. I can help you with that, but not with the spelling mistakes.

Remove the spelling mistakes and update the code.

First thing you need to check is that all function names, class names, variable names have to be consistent. dispRecord is not equal to disprecord. There are atleast 50+ mistakes which are similar to this.

After that check for missing semicolons, missing closing brackets, periods/full-stops instead of semicolons etc..

If you are finding it difficult to remove all the errors at one go and the errorlist seems too big to handle, try commenting out all the code except the class definitions and a blank main().

Comment out all the class function declarations and the code should compile. Then add one function at a time to the code and remove errors from that.
 
@pr0ing : I known that the R != r but the book itself have it like that :(

I have checked for the spelling mistake after my first post and did found out my mistakes and did a corrections in that and then the Codes in 4th post is the out come :D

now there are errors related to only line no : 07,21

103,37

103,37

104,32

143,21

162,22

162,22

and that is what i am not getting :(

I am new to c++ and so trying out some new ways to learn it .

basic's are also going on side by side but the error seems to be :S to me .

--- Updated Post - Automerged ---

till now i use to use " getch()" but here in book it's given as "getche()" :S and i have never use getch with any other function like in this program it's have choice option :/

--- Updated Post - Automerged ---

here is a image of what error i am getting :)

cerror.png
 
it's all ready

Code:
{

               			dispRecords newRec;

                        newRec.displayCustomers();

               }

so are u trying to tell me that class should be added before dispRecords but i have tried that and noop :( nothing happend -- only new errors :S

--- Updated Post - Automerged ---

Ok i got what mehrotra.akash was trying to say about removing p form dispRecords { i think } and it worked but only one line error got solved :(

still the remaining part is as same as above :/
 
I had used the code from your latest post itself. The book can have errors but not to this extent. You are mentioning only 7 errors but more keep on popping up as you correct the existing errors.

If you are just starting to learn C++ then this code is not the best way to learn. Start with smaller programs or try the alternative mentioned below.

Did you try what I had mentioned in my last paragraph of the earlier post?

this code will compile as it only has the class definitions. Add a single function definition at a time and resolve all the errors from it. Keep on adding functions till you are done with the entire code. If you are having problems with variable names and their inconsistencies change everything to lowercase.

Code:
#include<iostream.h>

#include<fstream.h>

#include<process.h>

#include<string.h>

#include<stdlib.h>

#include<stdio.h>

#include<ctype.h>

#include<conio.h>

#include<dos.h>

#include<iomanip.h>

class Menus

{

public :

				void showmenu(void) ;

private :
				void closemenu(void) ;

};

class dispRecords

{

public :

				void addDetails(int,char name[50],char address[100],float);

				void displayCustomers(void);

				void deleteAccount(int);

				void updateBalance(int,float);

				void updateCustomer(void);

				int lastAccount(void);

				int accountExists(int);

				char *getName(int);

				char *getAddress(int);

				float getBalance(int);

				int getRecord(int);

				void display(int);

				void displaylist();

				int AccountNumber;

				char name[50], address[50];

				float intBalance;

				

};

class accountTransactions

{

public :

				void new_account(void);

				void closeAccount(void);

				void display_account(void);

				void transaction(void);

				void addDetails(int,int,int,int,char,char typeTransaction[15],float,float,float);

				void deleteAccount(int);

				int dateDiffer(int,int,int,int,int,int);

				float getInterest(int, float);

				void display(int);

				void showAccount(int);

				int AccountNumber;

				char trantype[10];

				int dday,mmont,yyear;

				char transactions;

				float intInterest, intamount, intBalance;

				static float calcInterest;

				void showInterest(void);

				

};
 
pr0ing is correct, this program code is way too complex for someone just learning C++

Start off with simpler programs which demonstrate just the features of C++

Then start moving on to larger ones slowly

Also, unless you are doing this for school/college, use gcc/MinGW(Codeblocks) as far as possible
 
WRONG.. SO WRONG:facepalm::facepalm::facepalm:
Okay, let me explain some of the wrongs that I noticed. I gave up fixing after I fixed some 50 typing errors.

1. spelling mistakes.
2. case sensitivity
3. opening/closing braces.
4. the string part in cout << "" doesnt span across lines.
Code:
cout<<"I am a
Programmer"; //wrong.
cout<<"I am a"
"Programmer"; //right
5. use vim with linux/visual studio express ed with windows. borland is extinct.
6. proper indentation of code, and dont mix spaces with tab characters.
7. Good practice is to write one class per cpp file.
8. getch takes one char input but doesnt print on the screen, getche takes one char input and also prints it on the screen.
9. use switch case instead of if else if loops as its more readable.
Code:
if (choice == '1')
               {
               			accountTransactions objAT;
                        objAT.new_account();
               }
               else
               if	(choice == '2')
               {
               			accountTransactions objAT;
                        objAT.display_account();
               }
               else
               if	(choice == '3')
               {
               			dispRecords newRec;
                        newRec.displayCustomers();
               }
               else
               if	(choice == '4')
               {               }
                        int record ;
                        record = getRecord(retrieve_AccNo) ;
                        fstream filename ;
                        filename.open("newrecords.dat",ios::in);
                        file.seekg(0,ios::end);
                        int location;
                        location = (record) = sizeof(dispRecords);
                        filename.seekp(loaction);

                        while (filename.read((char*) this, sizeof(dispRecords))
                        {
                        if (retrieve_AccNo == AccountNumber)
                        {
                        		cout<<"\n ACCOUNT NO. 	:"<<Accountnumber;
                              cout<<"\n Name          :"<<name;
                              cout<<"\n Address			:"<<address;
                              cout<<"\n Balance			:"<<intBalance;
                              break;
                        }
               }
10. stick to one convention. dont mix two. many feel that the second is more readable and doesnt confuse the editors.
Code:
if (conditon) {
   statements
}
or 
if (condition)
{
    statements
}
11. filename.read((char*) this, sizeof(dispRecords)) statements like these create lot of chaos. it currupts the object, instead read into temp object instead of this and then use copy constructors.
12. Before writing objects into files, learn about structure padding and serialize the structures accordingly. else chaos :)
13. next time if you are typing from book, type one function then compile, fix, then type the next function. makes life easy.

Learn how to program in style :bleh:
Byi7n.png

code if you want to use:
Code:
#include<iostream.h>
#include<fstream.h>
#include<process.h>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#include<ctype.h>
#include<conio.h>
#include<dos.h>
#include<iomanip.h>

class Menus
{
    public :
        void showmenu(void) ;
    private :

        void closemenu(void) ;
};

class dispRecords
{
    public :
        void addDeatails(int,char name[50],char address[100],float);
        void displaycustomers(void);
        void deleteAccount(int);
        void updateBalance(int,float);
        void updateCustomer(void);
        int lastAccount(void);
        int accountExists(int);
        char *getName(int);
        char *getAddress(int);
        float getBalance(int);
        int getRecord(int);
        void display(int);
        void displaylist(int);
        int Accountnumber;
        char name[50], address[50];
        float intBalance;

};
class accountTransactions
{
    public :
        void new_account(void);
        void closeAccount(void);
        void display_account(void);
        void transaction(void);
        void addDetails(int,int,int,int,char,char typeTransaction[15],float,float,float);
        void deleteAccount(int);
        int dateDiffer(int,int,int,int,int,int);
        float getInterest(int, float);
        void display(int);
        void showAccount(int);
        int AccountNumber;
        char trantype[10];
        int dday,mmont,yyear;
        char transactions;
        float intInterest, intamount, intBalance;
        static float calcInterest;
        void showInterest(void);

};

void Menus    ::     showmenu(void)
{
    char choice;
    while(1)
    {
        clrscr();
        cout<<"    \n ------- Welcome to Banking System Application ------- \n";
        cout<<"********************************************** \n           \n";
        cout<<" Choose form the Option                                               \n";
        cout<<" ___________________________________                              \n";
        cout<<"            1:Open an New Account                                        \n";
        cout<<"            2:View an Account                                           \n";
        cout<<"            3:Show all Accounts                                           \n";
        cout<<"            4:Make a Transaction                                          \n";
        cout<<"            5:Calculate Intreset                                          \n";
        cout<<"            6:Close an Account                                           \n";
        cout<<"            7:Exit \n                                                       \n";
        cout<<"          Pleas Select A choice :                                      \n";

        choice = getche();

        if (choice == '1')
        {
            accountTransactions objAT;
            objAT.new_account();
        }
        else
            if    (choice == '2')
            {
                accountTransactions objAT;
                objAT.display_account();
            }
            else
                if    (choice == '3')
                {
                    dispRecords newRec;
                    newRec.displayCustomers();
                }
                else
                    if    (choice == '4')
                    {               }
        int record ;
        record = getRecord(retrieve_AccNo) ;
        fstream filename ;
        filename.open("newrecords.dat",ios::in);
        file.seekg(0,ios::end);
        int location;
        location = (record) = sizeof(dispRecords);
        filename.seekp(loaction);

        while (filename.read((char*) this, sizeof(dispRecords)))
        {
            if (retrieve_AccNo == AccountNumber)
            {
                cout<<"\n ACCOUNT NO.     :"<<Accountnumber;
                cout<<"\n Name          :"<<name;
                cout<<"\n Address            :"<<address;
                cout<<"\n Balance            :"<<intBalance;
                break;
            }
        }
    }

    filename.close();
}
char    *dispRecords    ::    getName(int retrieve_AccNo)
{
    fstream filename;
    filename.open("*newrecords.dat", ios::int);
    filename.seekg(0,ios::beg);
    char retrieve_CustName[50];

    while (filename.read((char*) this, sizeof(dispRecords)))
    {
        if (AccountNumber == retrieve_Accno)
        {
            strcpy(retrieve_CustName,name);
        }
    }
    filename.close();
    return retrieve_CustName;
}

char* dispRecords :: getAddress (int retrieve_AccNo)
{
    fstream filename;
    filename.open("newrecords.dat", ios::in);
    filename.seekg(0,ios::beg);
    char retrieve_Address[100];

    while (filename.read((char*)this, sizeof(dispRecords)))
    {
        if (AccountNumer == retrieve_Accno)
        {
            strcpy(retrieve_Address,address);
        }
    }
    filename.close();
    return retrieve_Address;
}

float dispRecords :: getBalance(int retrieve_AccNo)
{
    fstream filename;
    filename.open("newrecords.dat",ios::in);
    filename.seekg(0,ios::beg);
    float iBalance;
    while (filename.read((char*) this, sizeof(dispRecords)))
    {
        if (AccountNumber == retrieve_AccNo)
        {
            iBalance = intBalance;
        }
    }
    filename.close();
    return ibalance ;
}

int dispReecords :: accountExists(int, Retrieve_AccNo)
{
    stream filename;
    filename.open("newrecords.dat", ios::in);
    filename.seekg(0;ios::beg);
    int count=0;
    while(filename.read((char*) this, sizeof(dispRecords)))
    {
        if (AccountNumber == retrieve_AccNo)
        {
            count = 1;
            break;
        }
    }
    filename.close();
    return count;
}

void dispRecords :: displayList()
{
    cout<<"";

    int day1,mont1,year1;
    struct date dateval;
    getdate(&dateval);
    day1 = dateval.da_day;
    month1 = dateval.da_mon;
    year1 = dateval.da_year;
    cout<<" \n Date : " <<day1 <<"/" <<month1 <<"/" <<year1<<"\n";
    cout<<setw(80)<<"__________________________________________\n";
    cout<<setw(23)<<" ACCOUNT NO. ";
    cout<<setw(23)<<"NAME OF PERSON";
    count<<setw(23)<<"BALANCE \n";
    cout<<setw(23)<<"_______________________________________\n";
}

void dispRecords :: displaycustomers (void)
{

    clrscr();
    int lenl;
    int row=8, check;
    fstream filename;
    FILE = pFile;
    pFile = fopen("newrecords.dat","r");
    if (pFile == NULL)
    {
        cout<<"\n No Account Exists. Please go back to the previous menu. \n";
        getch();
        return;
        //fclose (pFile);
    }
    else
    {
        displayList():
            filename.open("newrecords.dat",ios::in);
        filename.seekg(0,ios::beg);
        while(filename.read((char*) this, sizeof(dispRecords)))
        {
            check = 0 ;

            cout.fill (' ');
            cout <<setw(20);
            cout.setf(ios::right, ios::adjustfield);
            cout<<AccountNumber;
            cout.fill (' ');
            cout <<setw(25);
            cout.self(ios::internal, ios::adjustfield);
            cout<<name;

            cout<<setw(23);
            cout.setf(ios::right,ios::adjustfield);
            cout<<intBalance<<"\n";
            row++;
            if (row == 23)
            {
                check =1 ;
                row = 8 ;
                cout<<" \n\n Continue the Application ....... \n";
                getch();
                clrscr();
                dispList();
            }
        }
    }
    filename.close();
    if (!check)
    {
        cout<<"\n\n Continue the Application....... \n";
        getch();

    }
}
void dispRecords :: addDetails (int retrieve_AccNo, char retrieve_CustNmae[30],char retrieve_Address[60], float iBalance)

{
    AccountNumber = retrieve_AccNo;
    strcpy(nsme,retrieve_CustName);
    strcpy(address,retrieve_Address);
    intBalance = iBalance;
    fstream filename;
    filename.open("newrecords.dat", ios::out | ios::app);
    filename.write((char*) this, sizeof(dispRecords));
    filename.close();

}

void dispRecords :: deleteAccount(int retrieve_AccNo)
{
    fstream filename;
    filename.open("newrecords.dat", ios::in);
    fstream temp;
    temp.open("calculation.txt", ios::out);
    filename.seekg(0,ios::beg);
    while (filename.eof())
    {
        filename.read((char*) this, sizeof(disprecords));
        if (filename.eof())
            break;
        if (AccountNumber !=retrieve_AccNo)
            temp.write((char*) this, size(dispRecords));
    }
    filename.close();
    temp.close();
    filename.open("newrecords.dat", ios::out);
    temp.open("calculations.txt", ios::in);
    temp.seekg(0,ios::beg);
    while ( !temp.eof())
    {
        temp.read((char*) this, sizeof(dispRecords));
        if (temp.eof())
            break;
        filename.write((char*) this, sizeof(dispRecords));
    }
    filename.close();
    temp.close();
}
void dispRecords :: updateBalance(int retrieve_AccNo, float iBalance)
{
    int record ;
    record = getRecord(retrieve_AccNo);
    fstream filename;
    filename.open("newrecords.dat", ios::out| ios::ate);
    intBalance = iBalance;
    int location;
    location = (record-1)* sizeof(dispRecords);
    filename.seekg(loaction);
    filename.write((char*) this, sizeof(dispRecords));
    filename.close();
}
void accountTransactions :: addDetails(int retrieve_AccNo, int dey1, int month1, iht year1, char t_tran, char typeTransaction[10], float interest_accrued, float t_amount, float iBalance)
{

    fstream filename;
    filename.open("transactions.dat", ios::app) ;
    AccountNumber = retrieve_AccNo;
    dday = day1;
    mmonth1 = month1;
    yyear1 = year1;
    transaction = t_tran;
    strcpy(trantype,typeTransaction);
    intInterest = interest_accrued;
    intAmount = t_amount;
    intBalance = iBalance;
    filename.write((char*) this, sizeof(accountTransactions));
    filename.close();
}
void accountTrancastions :: deleteAccount(int retrieve_AccNo)
{
    fstream filename;
    filename.open("transactions.dat", ios::in);
    fstream temp;
    temp.open("calculations.txt" , ios::out);
    filename.seekg(0,ios::beg);
    while ( !filename.eof())
    {

        filename.read((char*) this, sizeof(accountTransactions));
        if (filename.eof())
            break;
        if ( AccountNumber != retrieve_AccNo)
            temp.write((char*) this, sizeof(accountTransactions));
    }
    filename.close();
    temp.close();
    filename.open("transactions.dat", ios::out);
    temp.open("calculations.txt", ios::in);
    temp.seekg(0, ios::beg);
    while ( ! temp.eof())
    {
        temp.read((char*) this, sizeof(accountTransactions));
        if (temp.eof())
            break;
        filename.write((char*) this, sizeof(accountTransactions));
    }
    filename.close();
    temp.close();
}
void accountTransactions :: new_account(void)
{

    char choice;
    int i, check;
    clrscr();
    dispRecords newRec ;
    cout<<"            Please press 0 to go back to previous menu. \n";
    cout<<"                            \n";
    cout<<"            ---Open a New Bank Account---   \n";
    cout<<"                ***********************      \n";
    int day1,month1,year1;
    struct date dateval;
    getdate(&dateval);
    day1 = dateval.da_day;
    month1 = dateval.da_mon;
    year1 = dateval.da_year;
    int retrieve_AccNo;
    retrieve_AccNo = newRec.lastAccount();
    retrieve_AccNo++ ;

    if (retrieve_AccNo  == 1)
    {

        newRec.addDetails(retrieve_AccNo,"ravi","Delhi",1.1);
        newRec.deleteAccount(retrieve_AccNo);
        addDetails(retrieve_AccNo,1,1,1997,'D',"default value",1.1,1.1,1.1);
        deleteAccount(retrieve_AccNo);
    }
    char retrieve_CustName[30], tran_acc[10], retrieve_Address[60];
    float t_bal, iBalance;
    cout<<" Date: "<<day1<<"/"<<month1<<"/"<<year1<<"\n";
    cout<<" Accout No. # "<<retrieve_AccNo;
    do
    {
        cout<<"\n\n   Please Enter the Name of the Account Holder : ";
        check = 1;
        gets(retrieve_CustName);
        if (retrieve_CustName[0] == '0' )

        {
            cout<<" \n\t            Invalid Customer Name.";
            getch();
            return;
        }
        strupr(retrieve_CustName);
        if (strlen(retrieve_CustName) == 0 || strlen(retrieve_CustName) > 30 )
        {
            check = 0;
            cout<<"\t\n Customer Name is either Blank ot it's lenght is greater than 30 characters. \n";
            getch();
        }
    } while (!check);

    do
    {
        cout<<"\n                Please Enter the Account Holder's Address : ";
        check = 1;
        gets(retrieve_Address);
        if (retrieve_Address[0] == '0')
        {
            cout<<"\n\t       Invalid Customer Address.";
            getch();
            return;
        }
        strupr(retrieve_Address);
        if (strlen(retrieve_Address) < 1 || strlen(retrieve_Address) > 60)
        {
            check = 0;
            cout<<"\t\n            Customer Address is Either Blank or its length is greater than 60 characters.\n";
            getch();
        }
    }while (!check);

    do
    {
        char chrVerfiyingPerson[30];
        cout<<"\n Please Enter the name of the Verifying Person of the Account Holder: ";
        check = 1;
        gets(chr_VerfiyingPerson);
        if (char_VerifyingPerson[0] == '0')
        {
            cout<<"\n\t         Invalid Verfiying Perosn Name. ";
            getch();
            return;

        }
        strupr(chrVerfiyingPerson);
        if (strlen(chr_VerifyingPerson) < 1 || strlen(chr_VerifyingPerson) > 30)
        {
            check = 0;
            cout<<"\t\n The verifying Person's Name is either blank or greater than 30 characters. Please try again. \n ";
            getch();
        }
    }while (!check);

    do
    {
        cout<<"\n Please Enter the Deposit Amount while opening a New Account :";
        check = 1 ;
        gets(tran_acc);
        iBalance = t_bal;
        if (strlen(tran_acc) < 1 ) {
            cout<<"\n Invalid Transaction value. Exiting from the current Menu. \n";
            getch();
            return;
        }
        if (iBalance < 1000 )
        {
            check = 0 ;
            cout<<"\t\n The Minimum Amount Should be Rs. 1000. Please try again. \n ";
            getch();
        }
    } while (!check) ;

    do
    {

        cout <<"\n    Do you want to save the record ? (y/n) : ";
        choice = getch();
        choice = toupper(choice);
    } while (choice != 'N' && choice != 'Y');
    if (choice  == 'N' || choice =='n')
    {
        cout<<" \n The Customer Account is not created \n. Please continue wiht the application. \n";
        getch();
        return;
    }
    float t_amount, interest_accrued ;
    t_amount = iBalance ;
    interest_accrued = 0.0 ;
    char t_tran, typeTransaction[10] ;
    t_tran = 'D' ;
    strcpy(typeTransaction," ");
    newRec.addDetails(retrieve_AccNo,retrieve_CustName,retrieve_Address,iBalance) ;
    addDetails(retrieve_AccNo,day1,month1,year1,t_tran,typeTransaction,interest_accrued,t_amount,iBalance);
    cout<<"\n\n                    The New Account is Successe\fully Created. \nPlease continue with this application. \n";
    getch();
}

void accountTransactions :: showAccount(int retrieve_AccNo)
{
    cout<<"\n";

        int day1,month1,year1 ;
    struct date dateval;
    getdate(&dateval);
    day1 = dateval.da_day ;
    month1 = dateval.da_mon;
    year1 = dateval.da_year;
    cout <<" Date : " <<day1 <<"/" << month1 <<"/" << year1 <<"\n" ;
    cout <<"Account No. " <<retrieve_AccNo ;
    dispRecords newRec ;

    char retrieve_CustName[30] ;
    strcpy(retrieve_CustName,newRec.getAddress(retrieve_AccNo)) ;
    char retrieve_Address[60]    ;
    strcpy(retrieve_Address,newRec.getAddress(retrieve_AccNo))    ;

    cout<<setw(25)<<"\n Account Holder's Name : "<<retrieve_CustName;
    cout<<"\nAddress             :         "<<retrieve_AccNo<<"\n";
    cout<<setw(80)<<"\n ____________________________________ \n";
    cout<<setw(10)<<"Dated";
    cout<<setw(12)<<"Details";
    cout<<setw(12)<<"Deposited";
    cout<<setw(15)<<"Withdrawn";
    cout<<setw(12)<<"                ";
    cout<<setw(10)<<"Balance";
    cout<<setw(80)<<"\n ____________________________________ \n";
}

void accountTransactions :: display_account(void)
{
    clrscr();
    char t_acc[10];
    int tran_acc, retrieve_AccNo;
    dispRecords obj2;
    cout<<"             Press 0 to go to the previous menu. \n";
    cout<<"             Please Enter the Account No. you want to view : " ;
    gets(t_acc);
    tran_acc = atoi(t_acc);
    retrieve_AccNo = tran_acc;
    if (retrieve_AccNo ==  0)
    {
        cout<<"\n            You Have Pressed 0 to exit. \n";
        getch();
        return;
    }
}
 
@booo 'ji : IF the code you have provided @ the end of the program are correction one then just have a look at the error i am getting in c++ :(

97131369.png


and @ university level that to f.y.bsc.I.T We are still with the blue screen c++ :( still i moved with borland 5.2 which supports windows 7 .

Request to all Please post some good links where I can learn C++ in good or name and author of a Good reference book which I can let my college order it for us :p

right now I am using object oriented programming with c++ ------- 4th edition by E Balagurusamy .
 
Buddy, that blue screen though obsolete; will still clear your doubts easily. You are at very basic; I have not looked at the code in detail but my guess is that it all is doable in old compiler as well. Now your problem is that you are trying to bite more than you can chew.

Typically you are suppose to work like,

1) Read what is a class, create a class, create an object of it. compile/link it(or build it), see if it is running as expected.

2) Add constructor, member variables to the class, initialize the variable in constructor, compile/link it(or build it), see if it is running as expected.

3) Add a member function, say Show, print the value of variable on screen in this function, call this function from main compile/link it(or build it), see if it is running as expected.

4) Add a member function, say Input, take input from user and store it in the member variables, call this function from main, call Show after this function. compile/link it(or build it), see if it is running as expected.

5) Now try to create two objects of this class, call input with one object, call show on another object. run it, observe the output, try to understand what has happened.

This is very basic stuff, and you are suppose to do it one by one and without any help (personal or from website), read the book, try to write it, can not? read the book again.

Copying code from internet will not help you at all. once you have done all the above; try to rewrite the code from book again. I said re-write not copy; see what the author wants to do; do it yourself; its quite simple.

Good luck and Happy programming
 
princeoo7 said:
@booo 'ji : IF the code you have provided @ the end of the program are correction one then just have a look at the error i am getting in c++ :(

that code has errors too. He has mentioned that he gave up after fixing about 50 typing errors. If you just want the finished code here instead of trying out suggestions then you are probably not gonna get it.

princeoo7 said:
Request to all Please post some good links where I can learn C++ in good or name and author of a Good reference book which I can let my college order it for us :p

right now I am using object oriented programming with c++ ------- 4th edition by E Balagurusamy .

There are a lot of threads on this forum itself where C/C++ books are recommended. Search for those and keep this thread for solving this problematic code.

I had given a code which is bug free and suggested how to continue with that. Have you tried that? Do you have any updated code to post here?

Also please read each and every point from boo's post and try to understand what he means by that. If anything is not clear ask specific questions.
 
princeoo7 said:
@booo 'ji : IF the code you have provided @ the end of the program are correction one then just have a look at the error i am getting in c++ :(

and @ university level that to f.y.bsc.I.T We are still with the blue screen c++ :( still i moved with borland 5.2 which supports windows 7 .

Request to all Please post some good links where I can learn C++ in good or name and author of a Good reference book which I can let my college order it for us :p

right now I am using object oriented programming with c++ ------- 4th edition by E Balagurusamy .

line 139: filename.open("*newrecords.dat", ios::int); should be filename.open("newrecords.dat", ios::in) spelling mistakes again as there is no such thing as "ios::int" and you cant use wildcards in file name.

line 145: if (Accountnumber == retrieve_Accno) //spelling mistake in AccountNumber should be Accountnumber

LIne 132: filename.close should be inside the while loop. i.e., in line 130. Read "scope, local and global variables."

Line 189: int dispRecords :: accountExists(int Retrieve_AccNo) //spelling mistake

Line 186: return iBalance ; //spelling mistake again.

Line 180: if (Accountnumber == retrieve_AccNo) //same spelling mistake.

Line 163: if (Accountnumber == retrieve_AccNo) :facepalm:

my humble request. dont read balaguruswamy. :)
 
Thank you booo 'ji :) your post are really help full and I did expected some explanation like you have given :) --- thank you very much :D
 
back in 1998.. i used to read books written by yaswant kanetkar...excellent books for learning C, C++, pointers in c. He explains in a way every beginner can understand and also takes you to more advanced levels
 
Back
Top