0% found this document useful (0 votes)
121 views

Banking Record System: Project Report

This document describes a banking record system project in C++. The project uses various functions to add, display, search, edit, and delete banking records stored in a file. The code defines a class to hold account information and implements functions for inputting, outputting, and modifying data. The main function runs a menu-driven program that allows the user to interact with and manage the banking records.

Uploaded by

D E W A N A
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views

Banking Record System: Project Report

This document describes a banking record system project in C++. The project uses various functions to add, display, search, edit, and delete banking records stored in a file. The code defines a class to hold account information and implements functions for inputting, outputting, and modifying data. The main function runs a menu-driven program that allows the user to interact with and manage the banking records.

Uploaded by

D E W A N A
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

S haheed Zulfikar Ali Bhutto Institute of Science &

Technology

COMPUTER SCIENCE DEPARTMENT

PROJECT REPORT
(Banking Record System)

Submitted To: Muhammad Naveed

Submitted by:

 Huzaifa Nasir

 REG# 2080225

 Fahad Nouman

REG#2080221

1
TABLE CONTENTS:-

 Report Outline:
 Add Record:
 Show list/data:
 Search Record:
 Edit Record:
 Delete Record:

REPORT OUTLINE:
This report shows how to create Banking Record
System in C++ using different functions and terminologies.

ADD RECORD:
For this feature void read_data() function has been used to
add banking record into the file. It asks for information such as account number,
first name, last name and balance to be entered.

SHOW LIST/DATA:
With the information provided in add record, the void
show_data() function in this banking record system project in C++ show the
record corresponding to a particular account number, first name and last name.
Current balance of the account holder is displayed.

SEARCH RECORD:
When the function for this feature is first executed, it
shows the total records in the file, and the user can then search by record
number. If the record searched for is not found, the banking record system
project in C++ displays the message – “Error in opening! File Not Found!!”

2
EDIT RECORD:
This works in similar manner to the Search feature. When
the function for Edit Record is first executed, it shows the total records in the
file, and the user can edit the information by providing record number. Then, the
C++ project shows all the data in that record, and the user can enter any data to
modify. If the record to be edited for is not found, it displays the message –
“Error in opening! File Not Found!!”

DELETE RECORD:
First of all, when the function of this feature is executed,
it shows all the records in the file, and the user can enter the record number to
delete. If the record was not found, this banking record system project in C++
displays the message – “Error in opening! File Not Found!!”

CODE & SECREENSHORT OF THE PROJECTS:

CODE:
#INCLUDE<IOSTREAM>
#INCLUDE <FSTREAM>
#INCLUDE <CSTDLIB>
USING STD::COUT ;
USING STD::CIN ;

3
USING STD ::ENDL ;
USING STD::FSTREAM ;
USING STD::OFSTREAM ;
USING STD::IFSTREAM ;
USING STD::IOS ;
CLASS ACCOUNT _QUERY
{
PRIVATE :
CHAR ACCOUNT _NUMBER [20];
CHAR FIRST NAME [10];
CHAR LASTNAME [10];
FLOAT TOTAL _B ALANCE ;
PUBLIC :
VOID READ _ DATA ();
VOID SHOW _ DATA ();
VOID WRITE_ REC ();
VOID READ _ REC ();
VOID SEARCH _REC();
VOID EDIT_ REC ();
VOID DELETE _ REC ();
};

4
VOID ACCOUNT_ QUERY::READ_DATA()
{
COUT <<"\NENTER ACCOUNT NUMBER: ";
CIN >> ACCOUNT _ NUMBER ;
COUT <<"ENTER F IRST NAME : ";
CIN >> FIRST NAME ;
COUT <<"ENTER LAST NAME : ";
CIN >> LAST NAME ;
COUT <<"ENTER B ALANCE : ";
CIN >> TOTAL _B ALANCE ;
COUT <<ENDL;
}
VOID ACCOUNT _ QUERY ::SHOW _DATA ()
{
COUT <<"A CCOUNT NUMBER: "<< ACCOUNT _NUMBER<< ENDL ;
COUT <<"F IRST NAME : "<< FIRST NAME << ENDL ;
COUT <<"LAST NAME : "<< LAST NAME <<ENDL;
COUT <<"CURRENT BALANCE : R S. "<< TOTAL_BALANCE <<ENDL;
COUT <<"-------------------------------"<< ENDL ;
}
VOID ACCOUNT _ QUERY ::WRITE _REC()

5
{
OFSTREAM OUTFILE ;
OUTFILE .OPEN ("RECORD .BANK ", IOS:: BINARY |IOS ::APP );
READ _DATA ();
OUTFILE .WRITE (REINTERPRET _CAST <CHAR *>(THIS), SIZEOF(*THIS));
OUTFILE .CLOSE ();
}
VOID ACCOUNT _ QUERY ::READ _REC()
{
IFSTREAM INFILE ;
INFILE. OPEN (" RECORD . BANK ", IOS ::BINARY );
IF(! INFILE )
{
COUT <<"ERROR IN OPENING! FILE NOT FOUND !!"<< ENDL ;
RETURN ;
}
COUT <<"\N****DATA FROM FILE****"<< ENDL;
WHILE(!INFILE. EOF())
{
IF(INFILE. READ ( REINTERPRET _ CAST <CHAR *>( THIS ), SIZEOF (*THIS))>0)
{

6
SHOW_ DATA ();
}
}
INFILE. CLOSE ();
}
VOID ACCOUNT _ QUERY ::SEARCH _ REC ()
{
INT N;
IFSTREAM INFILE ;
INFILE. OPEN (" RECORD . BANK ", IOS ::BINARY );
IF(! INFILE )
{
COUT <<"\NERROR IN OPENING ! FILE NOT FOUND !!"<< ENDL ;
RETURN ;
}
INFILE. SEEKG (0,IOS ::END);
INT COUNT = INFILE.TELLG()/SIZEOF(*THIS);
COUT <<"\N T HERE ARE "<< COUNT <<" RECORD IN THE FILE ";
COUT <<"\N E NTER RECORD NUMBER TO SEARCH : ";
CIN >> N;
INFILE. SEEKG (( N-1)* SIZEOF (*THIS));

7
INFILE. READ( REINTERPRET _ CAST <CHAR*>(THIS), SIZEOF (* THIS ));
SHOW _DATA ();
}
VOID ACCOUNT _ QUERY ::EDIT _REC()
{
INT N;
FSTREAM IOFILE;
IOFILE. OPEN (" RECORD . BANK ", IOS ::IN|IOS ::BINARY );
IF(! IOFILE )
{
COUT <<"\NERROR IN OPENING ! FILE NOT FOUND !!"<< ENDL ;
RETURN ;
}
IOFILE. SEEKG (0, IOS::END );
INT COUNT = IOFILE.TELLG()/SIZEOF(*THIS);
COUT <<"\N T HERE ARE "<< COUNT <<" RECORD IN THE FILE ";
COUT <<"\N E NTER RECORD NUMBER TO EDIT: ";
CIN >> N;
IOFILE. SEEKG (( N-1)* SIZEOF (*THIS));
IOFILE. READ ( REINTERPRET _ CAST <CHAR *>( THIS ), SIZEOF (*THIS));
COUT <<"RECORD "<< N<<" HAS FOLLOWING DATA "<<ENDL;

8
SHOW_ DATA ();
IOFILE. CLOSE ();
IOFILE. OPEN (" RECORD . BANK ", IOS ::OUT | IOS::IN| IOS::BINARY );
IOFILE. SEEKP (( N-1)* SIZEOF (*THIS));
COUT <<"\NENTER DATA TO MODIFY "<<ENDL;
READ _DATA ();
IOFILE. WRITE( REINTERPRET _ CAST <CHAR *>( THIS ), SIZEOF (*THIS));
}
VOID ACCOUNT _ QUERY ::DELETE _REC()
{
INT N;
IFSTREAM INFILE ;
INFILE. OPEN (" RECORD . BANK ", IOS ::BINARY );
IF(! INFILE )
{
COUT <<"\NERROR IN OPENING ! FILE NOT FOUND !!"<< ENDL ;
RETURN ;
}
INFILE. SEEKG (0,IOS ::END);
INT COUNT = INFILE.TELLG()/SIZEOF(*THIS);
COUT <<"\N THERE ARE "<< COUNT <<" RECORD IN THE FILE ";

9
COUT<<"\ N ENTER RECORD NUMBER TO DELETE : ";
CIN >> N;
FSTREAM TMPFILE ;
TMPFILE .OPEN ("TMPFILE .BANK ", IOS:: OUT |IOS ::BINARY );
INFILE. SEEKG (0);
FOR (INT I =0; I<COUNT ; I++)
{
INFILE. READ ( REINTERPRET _ CAST <CHAR *>( THIS ),SIZEOF (* THIS ));
IF(I ==( N-1))
CONTINUE ;
TMPFILE .WRITE (REINTERPRET _CAST <CHAR *>(THIS), SIZEOF (* THIS ));
}
INFILE. CLOSE ();
TMPFILE .CLOSE ();
REMOVE (" RECORD . BANK ");
RENAME (" TMPFILE . BANK ", " RECORD . BANK ");
}
INT MAIN()
{
ACCOUNT _QUERY A;
INT CHOICE ;

10
COUT<<"***A COUNT INFORMATION SYSTEM***"<< ENDL ;
WHILE( TRUE)
{
COUT <<"S ELECT ONE OPTION BELOW ";
COUT <<"\N\T1-->A DD RECORD TO FILE ";
COUT <<"\N\T2-->SHOW RECORD FROM FILE";
COUT <<"\N\T3-->SEARCH RECORD FROM FILE";
COUT <<"\N\T4-->U PDATE RECORD ";
COUT <<"\N\T5-->D ELETE RECORD ";
COUT <<"\N\T6-->Q UIT ";
COUT <<"\NENTER YOUR CHOICE : ";
CIN >> CHOICE ;
SWITCH ( CHOICE )
{
CASE 1:
A. WRITE_REC();
BREAK ;
CASE 2:
A. READ_REC();
BREAK ;
CASE 3:
A. SEARCH _REC();
BREAK ;
CASE 4:
A. EDIT_REC();
BREAK ;
CASE 5:
A. DELETE_REC();
BREAK ;
CASE 6:
EXIT (0);
BREAK ;
DEFAULT :
COUT <<"\NENTER CORRET CHOICE ";
EXIT (0);
}
}
SYSTEM ("PAUSE ");
RETURN 0;
}

OUTPUT SCREENS:

11
12
CONCLUSION;-
This Project is based on a group work for
fundamentals of programming lab Second project which is submitted to
M.Naveed . Our project is about Banking Record System developed on C+
+. Above we have explain each detail of this project.

13

You might also like