Вы находитесь на странице: 1из 41

Banking

Banking
System

SUBMITTEDBY:
Vipin Kumar
905530

DATEOFSUBMISSION:20Jun2015
UndertheguidanceofMr.NaveenMittal
Submittedinpartialfulfillmentoftherequirementsforqualifying
DOEACCOLevel
Nameoftheaccreditedinstitute:M.M.(P.G.)CollegeModinagar

MICIPage1

Banking
ExecutiveDirector,
DOEACCSociety,
6,CGOComplex
LodhiRoad
NewDelhi110003

Sir,
IamsubmittingmyOLevelProjectforevaluation.DetailsofmyRegistrationandpostal
address,etcisasunder:
Regn.No:905530

LevelO

Name:VipinKumar
FathersName:Mr.RampalSingh
Address:
(a)

ResidentialAddress:GaliN.5,VijayNagarPost.Govindpuri

Modinagar,Distt.Ghaziabad_______
UttarPradesh___________________
TeleNo:

(b)

+919536632351
(CountryCode)(Mobilenumber)

OfficeAddress:

___________________________________
___________________________________
___________________________________

TeleNo:

Fax:

________________________
(CountryCode)(CityCode)(Telephonenumber)
________________________
(CountryCode)(CityCode)(Telephonenumber)

EmailAddress(Pleaseinblocklettersonly):SHIVKUMARVIPIN@GMAIL.COM

MICIPage2

Banking

INDEX

1.

Acknowledgement...
3

2.

Linked
list.4

3.

Types
of
list...5

linked

Singlylinkedlist..5
Doublylinkedlist.6
Circularlinkedlist6

4.
5.
6.
7.
8.

WhyLinkedListsAreGreatToStudy..7
DisadvantagesofLinkedList8
Definitionofbanking10
Functionsofbank..10
ABOUT
PROJECT11
Headerfilesusedintheprogram11
Methodsusedintheprogram...12

9.

MICIPage3

SourceCode..21

Banking

MICIPage4

Banking

Acknowledgement
ItakeimmensepleasureinthankingMr.PushkarAgarwal,
Director.
Iwishtoexpressmydeepsenseofgratitudetomyinternalguide,
Mr.NaveenMittalforhisableguidanceandusefulsuggestions,which
helpedmeincompletingtheprojectwork,intime.
Needlesstomentionthatasourceofinspirationandforhistimely
guidanceintheconductofmyprojectwork.Iwouldalsoliketothank
Mr.PankajSharmaforguidingmetomakethisproject.
Wordsareinadequateinofferingmythankstotheproject
assistants,MICIfortheirencouragementandcorporationincarrying
outtheprojectworkialsothankallthestaffmembersofourinstitute
andtechniciansfortheirhelpinmakingthisprojectasuccessfulone.
Finally,yetimportantly,iwouldliketoexpressmyheartfeltthanks
tomybelovedparentsfortheirblessings,myfriends/classmatesfor
theirhelpandwishesforthesuccessfulcompletionofthisproject.

MICIPage5

Banking

LinkedLists
Linkedlistsandarraysaresimilarsincetheybothstorecollections
ofdata.Theterminologyisthatarraysandlinkedlistsstore"elements"on
behalfof"client"code.Thespecifictypeofelementisnotimportantsince
essentiallythesamestructureworkstostoreelementsofanytype.Onewayto
thinkaboutlinkedlistsistolookathowarraysworkandthinkaboutalternate
approaches.

WhatLinkedListsLookLike
Anarrayallocatesmemoryforallitselementslumpedtogetherasoneblockof
memory.Incontrast,alinkedlistallocatesspaceforeachelementseparatelyinits
ownblockofmemorycalleda"linkedlistelement"or"node".Thelistgetsis
overallstructurebyusingpointerstoconnectallitsnodestogetherlikethelinksin
achain.Eachnodecontainstwofields:a"data"fieldtostorewhateverelement
typethelistholdsforitsclient,anda"next"fieldwhichapointerisusedtolink
onenodetothenextnode.Eachnodeisallocatedintheheapwithacallto
malloc(),sothenodememorycontinuestoexistuntilitisexplicitlydeallocated
withacalltofree().

ThisdrawingshowsthelistbuiltinmemorybythefunctionBuildOneTwoThree()
(thefullsourcecodeforthisfunctionisbelow).Thebeginningofthelinkedlistis
MICIPage6

Banking
storedina"head"pointerwhichpointstothefirstnode.Thefirstnodecontainsa
pointertothesecondnode.Thesecondnodecontainsapointertothethirdnode,
andsoon.Thelastnodeinthelisthasits.nextfieldsettoNULLtomarktheend
ofthelist.Codecanaccessanynodeinthelistbystartingattheheadand
followingthe.nextpointers.Operationstowardsthefrontofthelistarefast
whileoperationswhichaccessnodefartherdownthelisttakeslongerthefurther
theyarefromthefront.This"linear"costtoaccessanodeisfundamentallymore
costlythentheconstanttime[]accessprovidedbyarrays.Inthisrespect,linked
listsaredefinitelylessefficientthanarrays.Drawingssuchasaboveareimportant
forthinkingaboutpointercode,somostoftheexamplesinthisarticlewill
associatecodewithitsmemorydrawingtoemphasizethehabit.Inthiscasethe
headpointerisanordinarylocalpointervariable,soitisdrawnseparatelyonthe
lefttoshowthatitisinthestack.Thelistnodesaredrawnontherighttoshowthat
theyareallocatedintheheap.

TypesOfLinkedList
Therearethreetypesoflinkedlist
(a)Singlylinkedlist
(b)Doublylinkedlist
(c)Circularlinkedlist

SinglylinkedlistInthistypeoflinkedlist,eachnodecontainstwofields
i.e.dataandalinkpointingtothenextnodeinthelist.
100

Node

10

102

Null
3

104

SINGLYLINKEDLIST

Thefirstnodeinthelistpointedbythestartpointer.Thelastnodeinthelisthasa
linkpointerfieldcontainingaXornull,indicatingendoflist.10,3,and4are

MICIPage7

Banking
thedataitemsandthelinksarerepresentedbyarrows.Theitemsandthelink
pointercombinedtogetherarecallednode.

DoublyLinkedListInthistypeoflinkedlist,eachnodecontainsdataand
twolinks,onelinkpointingtothepreviousnodeandonelinkpointingtothenext
node.Supposeweareinthemiddleofalinkedlistandwewanttodosome
operationwiththepreviousnode,thenwehavenowaytogotopreviousnode.It
means,wewillagaintraversefromstartingnode.Sothisisadrawbackofsingly
linkedlist.Howeverdoublylinkedlistcanbetraversedforwardaswellas
backward.

Start
100

Null
X

RightLink
10

102

Null
100

20

104

102

30

104
100
LeftLink

102

DOUBLYLINKEDLIST

inthedoublylinkedlist10,20,30arethevaluesofthedatafieldandlinksare
representedbytheforwardarrowsorarrowsinthereversedirection.Ineachnode,
therearetwolinks,onerepresentstheaddressofpreviousitemandtheotherthat
ofthenextitem.NullrepresentstheNullpointersaremaintained.Whentraversing
thelistfromthelefttoright.

CircularLinkedListoneoftheshortcomingofalinearsinglylinkedlist
isthathavingreachedtothepreviousnodeunlesstheaddressisavailable.Alsoto
reachthefirstnodeafterreachingthe,therewillbeaneedtotraversethewholelist
backwardifpointerareavailable.Supposewemakeasmallchangeinthestructure
ofalistsothattheaddressfieldofthelastnodeinthelistisnotnull,butitisthe
addressofthefirstnodeofthelist.Thenwehaveacircularlist.Insuchastructure,
MICIPage8

Banking
wecanreachanynodefromanyothernodeinthelistbymovingfromoneendto
anotherend.

CIRCUARLINKEDLIST

WhyLinkedListsAreGreatToStudy
Linkedlistsholdaspecialplaceintheheartsofmanyprogrammers.Linkedlists
aregreattostudybecause.
NiceDomainThelinkedliststructureitselfissimple.Manylinkedlist
operationssuchas"reversealist"or"deletealist"areeasytodescribeand
understandsincetheybuildonthesimplepurposeandstructureofthelinked
listitself.
ComplexAlgorithmEventhoughlinkedlistsaresimple,thealgorithms
thatoperateonthemcanbeascomplexandbeautifulasyouwant.It'seasy
tofindlinkedlistalgorithmsthatarecomplex,andpointerintensive.
PointerIntensiveLinkedlistproblemsarereallyaboutpointers.The
linkedliststructureitselfisobviouslypointerintensive.Furthermore,linked
listalgorithmsoftenbreakandreweavethepointersinalinkedlistasthey
go.Linkedlistsreallytestyourunderstandingofpointers.
VisualizationVisualizationisanimportantskillinprogrammingand
design.Ideally,aprogrammercanvisualizethestateofmemorytohelp
thinkthroughthesolution.EventhemostabstractlanguagessuchasJava
andPerlhavelayered,referencebaseddatastructuresthatrequire
visualization.Linkedlistshaveanaturalvisualstructureforpracticingthis
sortofthinking.It'seasytodrawthestateofalinkedlistandusethat
drawingtothinkthroughthecode.
MICIPage9

Banking

DynamicalItisnotnecessarytoknowinadvancethenumberof
elementstobestoredinthelinkedlistandtherefore,neednottobeallocate
memorybeforehand.Memorycanbeallocatedasandwhen

necessary.Bythistechniquememoryisallocatedandreleasedto
thesystemduringtheexecutionoftheprogramratherthanfixedin
advance.Themechanismtoallocatememorydynamicallyis
providedbythestandardClibraryfunctionmalloc().

EasyManipulationInthelinkedlist,insertionsanddeletionscanbe
handledefficientlywithoutfixingthesizeofthememoryinadvance.

MemoryefficientAnimportantadvantageoflinkedlistoverarraysisthat
thelinkedlistusesexactlyasmuchmemoryasitneeds,andcanbemadeto
expandtofillallavailablememorylocationsifneeded.Thesizeofanarray
isfixedwhenitiscreated.Inlinkedlisttheindividualitemdonotneedtobe
locatedcontinuouslyinmemory,thewayarrayelementsare,theycanbe
scatteredanywhereinthememory.

Nottoappealtoyourmercenaryside,butforalloftheabovereasons,linkedlist
Problemsareoftenusedasinterviewandexamquestions.Theyareshorttostate,
andhavecomplex,pointerintensivesolutions.Noonereallycaresifyoucanbuild
linkedlists,buttheydowanttoseeifyouhaveprogrammingagilityforcomplex
algorithmsandpointermanipulation.Linkedlistsaretheperfectsourceofsuch
problems.
DisadvantagesOfLinkedList
Disadvantagesoflinkedlistare
Themaindisadvantageofusingalinkedlististhatyoulosetherandom
accessordirectaccesscapabilitytoavalueinthelist.Tofindagivenvalue
youhavetotraversethelist,whichtakesmoretimethananarray.
Onedisadvantageofalinkedlististhatyoucannottraverseitbackwards.To
mitigatethisissue,youcanuserecursiveprogrammingoryoucanbuilda
doublylinkedlist,atthecostofmorestorageandmoreprocessing.A
MICIPage10

Banking
common,nonrecursive,nondoublylinked,algorithmtosearchanodeand
manipulateitistowalkthroughthelistkeepingtwopointers,onetothe
nodeinquestion,andonetothepriornode
Anotheradvantageofarraysinaccesstimeisspeciallocalityinmemory.
Typicallyarraysaredefinedascontiguousblocksofmemory,andsoany
arrayelementwillbephysicallynearitsneighbors.Thisgreatlybenefits
frommodernCPUcachingmethods.
Adoublylinkedlistisbetterthananarrayforinsertionsanddeletionssince
eachnodehasareferencetoitsprecedingandproceedingsnodes.Therefore,
simplychangingthosereferencesisallthat'sneeded.Witharrays,youmust
shiftalltheelementsaftertheindexofinsertion.Thus,there'sasignificant
differenceinalgorithmcomplexity,resultinginlongerruntimeswhenusing
arrays.
Linkedlistsareslowerforsearchingsincenodesareusuallylocatedat
randomplacesinmemory,unlikearrayselements,whicharesequentially
ordered.
Traversalistimeconsumingasyouhavetostartfromthefirstnodeevery
timealsoyoucannotgobacktothepreviousnode,youhavetostartallover
again,caremustbetakentoinsertordeleteaitemfromthemiddle,anode
takesmoresizethandata[tostoreadditionalpointersetc.
Linkedlisthavelotofdisadvantagesandthemainbeinginmost
programmingenvironmentLinkedlistsareallocatedinHeapwhichwillbe
costlyconsideringperformancewhereasarraysareallocatedinstackwhich
willbefast.MaintenanceoverheadwithLinkedlistishugecomparing
arrays.
Increasedoverheadforstoringpointerstolinkingthedataitems.

Linkedlistallowonlysequentialaccesstoelementswhilearraysallowrandom
access.Linkedlistrequiresanextrastrongforreferences,whichoftenmakesthem
impracticalforlistsofsmalldataitemssuchascharactersorBooleanvalues.

MICIPage11

Banking

Banking System
Definitionofbanking"Thebankundertakestoreceivemoneyandto
collectbillsforitscustomer'saccount.Theproceedssoreceivedarenottobeheld
intrustforthecustomer,butthebankborrowstheproceedsandundertakesto
repaythem.Thepromisetorepayistorepayatthebranchofthebankwherethe
accountiskept,andduringbankinghours.Itincludesapromisetorepayanypart
oftheamountdueagainstthewrittenorderofthecustomeraddressedtothe
bankatthebranch.....Bankersneverdomakeapaymenttoacustomerinrespect
ofacurrentaccountexceptupondemand."
WhatIthinkiscommontoallmoderndefinitionsofbankingandessentialtothe
carryingonofthebusinessofbankingisthatthebankershouldacceptfromhis
customersloansofmoneyondeposit,thatistosay,loansforanindefiniteperiod
onrunningaccount,repayableastothewholeoranypartthereofondemandby
thecustomer...."

Functionsofbank
1. Createanaccount
2. Depositmoney
3. Withdrawmoney
4. Editthedetailsofanycustomer
5. Viewaccountstatusofanycustomer
6. Getviewofallcustomerdetails
7. Deleteanycustomerdetails
8. Transfermoneyfromoneaccounttoanother
9. Provideloanstocustomers
10.Providingmanyfinancialbenefitstocustomers.Etc.

MICIPage12

Banking

ABOUTPROJECT
Theprojectisbasicallymadetoexecutethebankingfunctions.Byusingthis
projectwecancreateanaccountaccordingtotheusersrequirementsay,ifuser
isrelatedtoanybusinessandneedtodepositandwithdrawmoneydaily,
customercanopenacurrentaccount.Ifuserwantstoopenanaccounttosave
moneyforthefuturehe/shecanopenasavingaccount.
Thisprogramisalsohelptomanipulatetheusersaccountslike,ausercan
depositmoneyontheotherhandusercanalsowithdrawmoney.Byusingthis
programausercanviewthedetailsofanycustomer.Thisprogramalsoprovides
thefacilitytoremoveentriesfromtherecordslist.

Headerfilesusedintheprogram

Stdio.h
Conio.h
String.h
Stdlib.h

Stdio.h:Thisheaderfileisusetooperateinputoutput
functions.printf(),scanf()etcfunctionsusedinthisprogram
aredefinedintheheaderfilestdio.h.

Conio.h:Thisheaderfileisusedtohendletheoutputofthe
program.Functionsusedinthisprogramlikegetch(),clrscr()
aredefinedinthisheaderfile.

String.h:Thisheaderfileisusedtooperatethestrings.
Functionsusedinthisprogramlikestrcmp(),strcpy()are
definedintheheaderfilestring.h.
MICIPage13

Banking

Stdlib.h:Thisheaderfileisalsoknownasstandard
library.Thisheaderfileprovidesfunctionslikemalloc(),
calloc(),andalsoexitetc,whichareusedinthisprogram.

Methodsusedintheprogram
dmenu()
dadd()
dfind()
dedit()
ddel()
ddisp()
ddisp1()
ddisp2()
dwith()
ddepo()
dcurrent_with()
dcurrent_depo()
deposit()
withdrawal()

dmenu():Thismethodisusedtodisplayallmenustothe
user.Thishelpsusertochoosetheoptionaccordingtotheir
requirement.

Themenuwillbeasfollows
MICIPage14

Banking

BANKINGDATABASE
================

1.Createanewaccount
2.Searchcustomerdetails
3.Editcustomerdetails
4.Deleteacustomer
5.Displayallaccountholders
6.Depositmoney
7.Withdrawalmoney
8.BalanceEnquiry
9.Exit

oVariablesIntegertypevariabledchtostoretheusers
Enteryourchoice(19):
choicefromthemenu.

oFunctionsprintf():Thismethodprintsthemessageonthe
screen.
scanf():thisfunctionretrievesthevaluegivenbytheuser
gotoxy().Thismovesthecursortothegivenpositioninthe
currentwindow.
oReturnvalueThismethodreturnsonevaluewhichisthechoiceofthe
user.

Dadd() :

thismethodidsusedtoaddnewnodeindata
structuretostorenewrecord.
Firstlyuserneedtoenterweathertheyaregoingtoopenasavinga/c
oracurrenta/c.

MICIPage15

Banking

Whichtypeofaccountyouwanttocreate?
1>Savings
2>Current
enteryourchoice:

ThismethodneedssomeentrieslikeFirstName,LastName,
TelephoneNumber,Depositsum.

oVariables:inttypenode*dptr,*dprevtypevariableis
usedtocheckwhetheruserwantstocreateasavinga/cor
currenta/c.*dptr,*dprevisusedtostorethememory
locationstonextandthepreviousnodes.
oFunctions:malloc().Thisfunctionisusedtoallocatethe
memoryatruntime.
oConditionsnloops:inthismethodweused
if()..elsestatement.tocheckconditionforsavingorcurrent
a/c.
do{..}while()loop:thisloopiteratestheblockuntil1000
entries.
oInthismethodwithinthecolumnofdepositamountiftheuser
enterstheamountbelowRs.500itwilldisplayanerror
messageINSUFFICIENTFUND.Souserneedtofillamount
aboveRs.500.

Dfind():thismethodfacilitatesusertofindtheinformation
aboutanycustomer.Byenteringa/cnumberusercanviewthedetails
ofcustomer.

MICIPage16

Banking

HELLORamWELCOMETOOURBANK
YouareaSAVINGSaccountholderofourbank
Accountnumber:5001
Firstname:Ram
Lastname:Kapoor
TelephoneNo.:1234567890
YourBalance:2500

Variables:node*dptrtostoretheofnextnode.
intno,numnoisusedtoretrievethea/cnoof
thecustomerandnumistochecktherangeoftheaccounts.
Thismethoddisplaysalltheinformationaboutthecustomer
likeaccountnumber,firstname,lastname,telephone
number,balance.
Thismethodfetchesvaluesfromthenodes,wherenodes
storesthevalueswhicharespecifiedinthestructure.

Dedit():Thismethodismadetoeditthedatastoredinthe
linkedlistsnodes.Thismethodworksuponthebasesoftheaccount
number,whoseaccountnumberisenteredbytheuser.

oIfuserentersanaccountnumberwhichdoesnotexistinthe
olistthenthismethoddisplaysamessage.
oIfthedatabasedoesnotcontainsanyrecordi.e.ifthefirst
pointercontainsthevalueNulltheitdisplaysthemessage
that,listcontainsnorecord.
MICIPage17

Banking

EnternumbertoEdit:5000
HELLOKapoorWELCOMETOOURBANK
OldFirstName:Ram
NewFirstName:Raj
OldLastName:Kapoor
NewLastName:Singh
PhoneNumber:123654
NewPhoneNumber:9632587410
OldBalance:4500
NewBalance:6000

oIftheuserwantstoedittheaccountbalance,itshouldbe
rememberbytheuserthatamountshouldbemorethanRs
500otherwiseitwillbeanerrormessageofinsufficient
fund.

Ddel():Thismethoddeletesthecustomersaccounts
accordingtotheusersrequirement.Thefollowingpointsworkwhen
deletingarecord
Enteryouraccountnotodelete:5000
DeletingRecord.....Confirm[y/n]:

MICIPage18

Banking

oThefirstnodewouldnotbeNull,ifthefirstnodisnullit
meansthatthereisnorecordinthelinkedlisttodelete.
oThismethodworksontheaccountnumberofthecustomer,
souserneedtoenterthecustomersaccountnumber.

Ddisp() :

Thismethoddisplaysrecordsofallcustomersofthe
bank,whohaveaccountsinbankwhetheritsisasavinga/coracurrent
account.Thismethodisbasicallyusedtodisplaythebasicdetailsofthe
user.

Customerdetails
HELLOKapoorWELCOMETOOURBANK
Accountnumber:5000
Firstname:Ram
Lastname:Kapoor
TelephoneNo.:1236547895
YourBalance:5555

Ddisp1() :

Thismethodissameasddisp()exceptthat,
ddisp()methodprintsthebasicdetailsofthecustomerbutthismethod
alsoshowswhetherthecustomerisasavingaccountholderoracurrent
accountholder.
Customerdetails
HELLOKapoorWELCOMETOOURBANK
Youareasavingaccountholderofourbank
Accountnumber:5000
Firstname:Ram
MICIPage19
Lastname:Kapoor
TelephoneNo.:1236547895
YourBalance:5555

Banking

Ddisp2() :Thismethodisdifferfromtheabovetwomethods
intheway,thatthismethoddisplaysthattheuserisa
currentaccountholder.Outputisasfollows.
Customerdetails
HELLOKapoorWELCOMETOOURBANK
Youareacurrentaccountholderofourbank
Accountnumber:5000
Firstname:Ram
Lastname:Kapoor
TelephoneNo.:1236547895
YourBalance:5555

Ddepo() :

Whenuwanttodepositmoneyinyoursaving
accountthattimethismethodtakesplaceinthe
program.
o Thismethodputsthevalueinthedefinednodes
variablewhichhasstoredthevalueofthedeposit
amount

Dwith() :

Thismethodworkswhenyouaregoingtowithdraw
amountfromyoursavingaccount.

EntertheaccountNo:5000

HELLOKapoorWELCOMETOOURBANK
AccountNo:5000
FirstName:ram
LastName:Kapoor
PhoneNumber:123454453
MICIPage20
YourBalance:1500
WithdrawalAmount:2000
INSUFFICIENTFUNDAminimumofRs.500/shouldbemaintained

Banking

o Thismethodlessthewithdrawalmoneyfromtheusers
accounti.e.accountdefinedbythenodefromwhich
userwantstowithdrawtheamount.
o Ifthewithdrawalamountismorethanthebalancing
amountofthecustomersaccount,thattimethe
programprintsamessageagainsttheuserthat
INSUFFICIENTFUNDAminimumofRs.500/
shouldbemaintained

Dcurrent_depo() :

Thismethodissameasddepo()
methodbutthismethodworksforthecurrentaccount
holders.Whenuserwantstowithdrawmoneyfromthe
currentaccountthattimethismethodtakesplace.

Dcurrent_with() :thismethodwithdrawsmoneyfrom
thecurrentaccount.Thismethodalsoworksinsame
manner,saywhenuserwantstowithdrawmoney
programasktheaccountnumberandgotothatnode
andlesstheamountfromtheaccount.

Deposit():

whenusergivecommandtodepositmoneyfrom
thespecificaccountfirstofallthismethodhasbeen
called.Whenthecontrolmovedtothismethodit
checkswhatkindofaccountholderthecustomeris.If

MICIPage21

Banking

thecustomerisasavingaccountholderthenthis
methodpassthecontroltotheddepo()method,elseit
passthecontroltothedcurrent_depo()method.
Thefurtherworkishandledbythesemethodswhichwe
havedefinedearlier.

Withdrawl():whenuserwantstowithdrawmoneyfrom
thespecificaccount,firstofallthismethodhasbeen
called.Whenthecontrolmovedtothismethodit
checkswhatkindofaccountholderthecustomeris.If
thecustomerisasavingaccountholderthenthis
methodpassthecontroltothedwith()method,elseit
passthecontroltothedcurrent_with()method.
Thefurtherworkishandledbythesemethodswhichwe
havedefinedearlier.

MICIPage22

Banking

Sourcecode
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
intdmenu()//mainmenu
voiddadd()//addtolist
voiddfind()//searchfromthelist
voiddedit()//edittherecord
voidddel()//deletefromthelist
voidddisp()//displayall
voidddisp1()
voidddisp2()
voiddwith()
voidddepo()
voiddcurrent_with()
voiddcurrent_depo()
voiddeposit()
voidwithdrawal()
structdnode
{
intnum,bal,check
chardlname[20],dfname[20],dtel[15]
structdnode*dnext
}
typedefstructdnodenode
node*dstart,*dtemp
inti=5000,chk=1,j=15000
intdmenu()
{
intdch
gotoxy(30,5)
MICIPage23

Banking

printf("BANKINGDATABASE")
gotoxy(30,6)
printf("================")
//gotoxy(3,24)
gotoxy(27,10)
printf("1.Createanewaccount")
gotoxy(27,11)
printf("2.Searchcustomerdetails")
gotoxy(27,12)
printf("3.Editcustomerdetails")
gotoxy(27,13)
printf("4.Deleteacustomer")
gotoxy(27,14)
printf("5.Displayallaccountholders")
gotoxy(27,15)
printf("6.Depositmoney")
gotoxy(27,16)
printf("7.Withdrawalmoney")
gotoxy(27,17)
printf("8.BalanceEnquiry")
gotoxy(27,18)
printf("9.Exit")
gotoxy(27,21)
printf("Enteryourchoice(19):")
gotoxy(55,21)
scanf("%d",&dch)
returndch
}
voiddadd()
{
inttype
MICIPage24

Banking

node*dptr,*dprev
dtemp=(node*)malloc(sizeof(node))
printf("\nWhichtypeofaccountyouwanttocreate?\n1>Savings\n2
>Current\nenteryourchoice:")
scanf("%d",&type)
if(type==1)
{
do{
printf("\nYourAccountNo:")
dtemp>num=i
printf("%d",dtemp>num)
i++
}while(i>10000)
printf("\nFirstname:")
scanf("%s",dtemp>dfname)
printf("Lastname:")
scanf("%s",dtemp>dlname)
printf("TelephoneNo.:")
scanf("%s",dtemp>dtel)
a:
printf("DepositSum:")
scanf("%d",&dtemp>bal)
if(dtemp>bal<500)
{
printf("INSUFFICIENTFUNDNeedaminimumofRs.500/toopenan
account\n")
gotoa
}
dtemp>dnext=NULL
if(dstart==NULL)
dstart=dtemp
else
{
dprev=dptr=dstart
while(strcmp(dtemp>dfname,dptr>dfname)>0)
MICIPage25

Banking

{
dprev=dptr
dptr=dptr>dnext
if(dptr==NULL)break
}
if(dptr==dprev)
{
dtemp>dnext=dstart
dstart=dtemp
}
elseif(dptr==NULL)
dprev>dnext=dtemp
else
{
dtemp>dnext=dptr
dprev>dnext=dtemp
}
}
ddisp1()
}
elseif(type==2)
{
do{
printf("\nYourAccountNo:")
dtemp>num=j
printf("%d",dtemp>num)
j++
}while(j>20000)
printf("\nFirstname:")
scanf("%s",dtemp>dfname)
printf("Lastname:")
scanf("%s",dtemp>dlname)
printf("TelephoneNo.:")
scanf("%s",dtemp>dtel)
m:
MICIPage26

Banking

printf("DepositSum:")
scanf("%d",&dtemp>bal)
if(dtemp>bal<500)
{
printf("INSUFFICIENTFUNDNeedaminimumofRs.500/toopenan
account\n")
gotom
}
dtemp>dnext=NULL
if(dstart==NULL)dstart=dtemp
else{
dprev=dptr=dstart
while(strcmp(dtemp>dfname,dptr>dfname)>0){
dprev=dptr
dptr=dptr>dnext
if(dptr==NULL)break
}
if(dptr==dprev){
dtemp>dnext=dstart
dstart=dtemp
}
elseif(dptr==NULL)
dprev>dnext=dtemp
else{
dtemp>dnext=dptr
dprev>dnext=dtemp
}
}
printf("YourprovidedChequenos.%dto%d",chk,chk+19)
ddisp2()
}
}
voiddfind()
MICIPage27

Banking

{
node*dptr
intno,num
if(dstart==NULL){
printf("\n\t\t\tNOACCOUNTDATABASE....\n")
getch()
return
}
printf("EntertheaccountNo:")
scanf("%d",&no)
dptr=dstart
while(dptr>num!=no)
{
dptr=dptr>dnext
if(dptr==NULL)break
}
if(dptr!=NULL)
{
if(dptr>num>=5000&&dptr>num<10000)
{
printf("\t\t\n")
if(dptr>num==no)
{
printf("\n\t\tHELLO%sWELCOMETOOURBANK",dptr>dlname)
printf("\n\t\tYouareaSAVINGSaccountholderofourbank")
printf("\n\t\tAccountnumber:%d",dptr>num)
printf("\n\t\tFirstname:%s",dptr>dfname)
printf("\n\t\tLastname:%s",dptr>dlname)
printf("\n\t\tTelephoneNo.:%s",dptr>dtel)
printf("\n\t\tYourBalance:%d",dptr>bal)
printf("\n\t\t\n")
}
}
else{
printf("\n\n")
MICIPage28

Banking

printf("\t\t\n")
if(dptr>num==no)
{
printf("\n\t\tHELLO%sWELCOMETOOURBANK",dptr>dlname)
printf("\n\t\tYouareaCURRENTaccountholderofourbank")
printf("\n\t\tAccountnumber:%d",dptr>num)
printf("\n\t\tFirstname:%s",dptr>dfname)
printf("\n\t\tLastname:%s",dptr>dlname)
printf("\n\t\tTelephoneNo.:%s",dptr>dtel)
printf("\n\t\tYourBalance:%d",dptr>bal)
chk=1
printf("\n\t\tChequenos:%dto%d",chk,chk+19)
printf("\n\t\t\n")
}
}
}
else
{
printf("NoMatchingRecordsFound.......\n")
}
getch()
}
voiddeposit()
{
intno
node*dptr,*dprev
if(dstart==NULL){
printf("\n\t\t\tNOACCOUNTDATABASE....\n")
getch()
return
}
printf("Enteryouraccountno:")
scanf("%d",&no)
MICIPage29

Banking

dptr=dstart
while(dptr>num!=no){
dptr=dptr>dnext
if(dptr==NULL)break
}
if(dptr!=NULL){
if(dptr>num>=5000&&dptr>num<10000)
{
ddepo()
}
else
{
dcurrent_depo()
}
}
else{
printf("\nNoMatchingRecordsFound.......")
}
getch()
}
voidddepo()
{
node*dptr
intbal
printf("\t\t\n\n")
printf("\n\t\tHELLO%sWELCOMETOOURBANK",dptr>dlname)
printf("\nAccountNo:%d\n",dptr>num)
printf("FirstName:%s\n",dptr>dfname)
printf("LastName:%s\n",dptr>dlname)
printf("PhoneNumber:%s\n",dptr>dtel)
printf("YourBalance:%d\n",dptr>bal)
printf("DepositAmount:")
scanf("%d",&bal)
MICIPage30

Banking

dptr>bal+=bal
printf("YourNewbalance:%d",dptr>bal)
getch()
}
voiddcurrent_depo()
{
node*dptr
intbal,ch
printf("\t\t\n\n")
printf("\n\t\tHELLO%sWELCOMETOOURBANK",dptr>dlname)
printf("\nAccountNo:%d\n",dptr>num)
printf("FirstName:%s\n",dptr>dfname)
printf("LastName:%s\n",dptr>dlname)
printf("PhoneNumber:%s\n",dptr>dtel)
printf("YourBalance:%d\n",dptr>bal)
printf("\nHowdoyouwishtodeposit?\n1>cash\n2>cheque\nEnter
yourchoice:")
scanf("%d",&ch)
if(ch==1)
{
printf("DepositAmount:")
scanf("%d",&bal)
dptr>bal+=bal
printf("YourNewbalance:%d",dptr>bal)
}
elseif(ch==2)
{
do{
printf("\nYourCheckNo:")
dtemp>check=chk
printf("%d\n",dtemp>check)
chk++
}while(chk>21)
printf("DepositAmount:")
MICIPage31

Banking

scanf("%d",&bal)
dptr>bal+=bal
printf("YourNewbalance:%d",dptr>bal)
}
getch()
}
voidwithdrawal()
{
node*dptr
intno
if(dstart==NULL){
printf("\n\t\t\tNOACCOUNTDATABASE....\n")
getch()
return
}
printf("EntertheaccountNo:")
scanf("%d",&no)
dptr=dstart
while(dptr>num!=no){
dptr=dptr>dnext
if(dptr==NULL)break
}
if(dptr!=NULL)
{
if(dptr>num>=5000&&dptr>num<10000)
{
dwith()
}
else
{
dcurrent_with()
}
MICIPage32

Banking

}
else{
printf("NoMatchingRecordsFound.......\n")
}
getch()
}
voiddwith()
{
node*dptr
intbal
printf("\t\t\n\n")
printf("\n\t\tHELLO%sWELCOMETOOURBANK",dptr>dlname)
printf("\nAccountNo:%d\n",dptr>num)
printf("FirstName:%s\n",dptr>dfname)
printf("LastName:%s\n",dptr>dlname)
printf("PhoneNumber:%s\n",dptr>dtel)
printf("YourBalance:%d\n",dptr>bal)
b:
printf("WithdrawalAmount:")
scanf("%d",&bal)
if((dptr>balbal)<500)
{
printf("INSUFFICIENTFUNDAminimumofRs.500/shouldbe
maintained\n")
gotob
}
dptr>bal=bal
printf("YourNewbalance:%d",dptr>bal)
getch()
}
voiddcurrent_with()
MICIPage33

Banking

{
node*dptr
intno,bal,ch
printf("\t\t\n\n")
printf("\n\t\tHELLO%sWELCOMETOOURBANK",dptr>dlname)
printf("\nAccountNo:%d\n",dptr>num)
printf("FirstName:%s\n",dptr>dfname)
printf("LastName:%s\n",dptr>dlname)
printf("PhoneNumber:%s\n",dptr>dtel)
printf("YourBalance:%d\n",dptr>bal)
printf("\nHowdoyouwishtodeposit?\n1>cash\n2>cheque\nEnter
yourchoice:")
scanf("%d",&ch)
if(ch==1)
{
b:
printf("WithdrawalAmount:")
scanf("%d",&bal)
if((dptr>balbal)<500)
{
printf("INSUFFICIENTFUNDAminimumofRs.500/shouldbe
maintained\n")
gotob
}
dptr>bal=bal
printf("YourNewbalance:%d",dptr>bal)
}
elseif(ch==2)
{
do{
printf("\nYourCheckNo:")
dtemp>check=chk
printf("%d\n",dtemp>check)
MICIPage34

Banking

chk++
}while(chk>21)
c:
printf("WithdrawalAmount:")
scanf("%d",&bal)
if((dptr>balbal)<500)
{
printf("INSUFFICIENTFUNDNeedaminimumofRs.500/toopenan
account\n")
gotoc
}
dptr>bal=bal
printf("YourNewbalance:%d",dptr>bal)
}
getch()
}

voiddedit()
{
node*dptr
intno,bal
if(dstart==NULL){
printf("\n\t\t\tNOACCOUNTDATABASE....\n")
getch()
return
}
printf("EnternumbertoEdit:")
scanf("%d",&no)
dptr=dstart
while(dptr>num!=no){
dptr=dptr>dnext
if(dptr==NULL)break
MICIPage35

Banking

}
if(dptr!=NULL){
printf("\t\t\n\n")
printf("\n\t\tHELLO%sWELCOMETOOURBANK",dptr>dlname)
printf("\nOldFirstName:%s",dptr>dfname)
printf("\nNewFirstName:")
scanf("%s",dptr>dfname)
printf("\nOldLastName:%s",dptr>dlname)
printf("\nNewLastName:")
scanf("%s",dptr>dlname)
printf("\nPhoneNumber:%s",dptr>dtel)
printf("\nNewPhoneNumber:")
scanf("%s",dptr>dtel)
printf("\nOldBalance:%d",dptr>bal)
m:
printf("\nNewBalance:")
scanf("%d",&bal)
if(bal<500)
{
printf("INSUFFICIENTFUNDAminimumofRs.500/shouldbe
maintained\n")
gotom
}
dptr>bal=bal
}
else{
printf("NoMatchingRecordsFound.......\n")
}
getch()
}
voidddel()
{
node*dptr,*dprev,*dtemp
intno
MICIPage36

Banking

chardyn='n'
if(dstart==NULL){
printf("\n\t\t\tNOACCOUNTDATABASE....\n")
getch()
return
}
printf("Enteryouraccountnotodelete:")
scanf("%d",&no)
dprev=dptr=dstart
while(dptr>num!=no){
dprev=dptr
dptr=dptr>dnext
if(dptr==NULL)break
}
if(dptr!=NULL){
printf("\nDeletingRecord.....Confirm[y/n]:")
dyn=getch()
printf("\n\n")
printf("\n\t\tHELLO%sWELCOMETOOURBANK",dptr>dlname)
printf("\nAccountNo:%d\n",dptr>num)
printf("FirstName:%s\n",dptr>dfname)
printf("LastName:%s\n",dptr>dlname)
printf("PhoneNumber:%s\n",dptr>dtel)
printf("Balance:%d\n",dptr>bal)
printf("")
if(dyn=='y'){
if(dptr==dstart){
dtemp=dstart>dnext
free(dstart)
dstart=dtemp
}
else{
dtemp=dptr>dnext
free(dptr)
dprev>dnext=dtemp
MICIPage37

Banking

}
printf("\n\n1RecordDeleted....")
}
else
printf("\n\nRecordnotDeleted....")
}
else{
printf("\nNoMatchingRecordsFound.......")
}
getch()
}

voidddisp()
{
node*dptr
if(dstart==NULL){
printf("\n\t\t\tNOACCOUNTDATABASE....\n")
getch()
return
}
clrscr()
printf("\t\t\n")
for(dptr=dstartdptr!=NULLdptr=dptr>dnext){
printf("\n\t\tHELLO%sWELCOMETOOURBANK",dptr>dlname)
printf("\n\t\tAccountnumber:%d",dptr>num)
printf("\n\t\tFirstname:%s",dptr>dfname)
printf("\n\t\tLastname:%s",dptr>dlname)
printf("\n\t\tTelephoneNo.:%s",dptr>dtel)
printf("\n\t\tYourBalance:%d",dptr>bal)
printf("\n\t\t\n")
}
getch()
}
MICIPage38

Banking

voidddisp1()
{
printf("\n\n")
printf("\t\t\n")
printf("\n\t\tHELLO%sWELCOMETOOURBANK",dtemp
>dfname)
printf("\n\t\tYouareaSAVINGSaccountholderofourbank")
printf("\n\t\tAccountnumber:%d",dtemp>num)
printf("\n\t\tFirstname:%s",dtemp>dfname)
printf("\n\t\tLastname:%s",dtemp>dlname)
printf("\n\t\tTelephoneNo.:%s",dtemp>dtel)
printf("\n\t\tYourBalance:%d",dtemp>bal)
printf("\n\t\t\n")
getch()
}
voidddisp2()
{
printf("\n\n")
printf("\t\t\n")
printf("\n\t\tHELLO%sWELCOMETOOURBANK",dtemp
>dlname)
printf("\n\t\tYouareaCURRENTaccountholderofourbank")
printf("\n\t\tAccountnumber:%d",dtemp>num)
printf("\n\t\tFirstname:%s",dtemp>dfname)
printf("\n\t\tLastname:%s",dtemp>dlname)
printf("\n\t\tTelephoneNo.:%s",dtemp>dtel)
printf("\n\t\tYourBalance:%d",dtemp>bal)
chk=1
printf("\n\t\tChequenos:%dto%d",chk,chk+19)
printf("\n\t\t\n")
getch()
}
voidmain()
{
intdch
MICIPage39

Banking

dstart=(node*)malloc(sizeof(node))
dstart=NULL
do{
clrscr()
dch=dmenu()
clrscr()
switch(dch){
case1:dadd()
break
case2:dfind()
break
case3:dedit()
break
case4:ddel()
break
case5:ddisp()
break
case6:deposit()
break
case7:withdrawal()
break
case8:dfind()
break
}
}while(dch!=9)
}
MICIPage40

Banking

MICIPage41

Вам также может понравиться