Ooo Ooooooooo Oooooooooo
description
Transcript of Ooo Ooooooooo Oooooooooo
-
Banking
MICIPage1
BankingSystem
SUBMITTEDBY:Vipin Kumar 905530
DATEOFSUBMISSION:20Jun2015
UndertheguidanceofMr.NaveenMittalSubmittedinpartialfulfillmentoftherequirementsforqualifyingDOEACCOLevelNameoftheaccreditedinstitute:M.M.(P.G.)CollegeModinagar
-
Banking
MICIPage2
ExecutiveDirector,DOEACCSociety,6,CGOComplexLodhiRoadNewDelhi110003
Sir,IamsubmittingmyOLevelProjectforevaluation.DetailsofmyRegistrationandpostaladdress,etcisasunder:Regn.No:905530 LevelOName:VipinKumarFathersName:Mr.RampalSinghAddress:
(a) ResidentialAddress:GaliN.5,VijayNagarPost.Govindpuri
Modinagar,Distt.Ghaziabad_______
UttarPradesh___________________
TeleNo: +919536632351(CountryCode)(Mobilenumber)
(b) OfficeAddress: ___________________________________
___________________________________
___________________________________
TeleNo: ________________________(CountryCode)(CityCode)(Telephonenumber)
Fax: ________________________(CountryCode)(CityCode)(Telephonenumber)
EmailAddress(Pleaseinblocklettersonly):[email protected]
-
Banking
MICIPage3
INDEX1. Acknowledgement...
32. Linkedlist.4
3. Types of linkedlist...5 Singlylinkedlist..5 Doublylinkedlist.6 Circularlinkedlist6
4. WhyLinkedListsAreGreatToStudy..75. DisadvantagesofLinkedList86. Definitionofbanking107. Functionsofbank..108. ABOUTPROJECT11 Headerfilesusedintheprogram11 Methodsusedintheprogram...12
9. SourceCode..21
-
Banking
MICIPage4
-
Banking
MICIPage5
AcknowledgementItakeimmensepleasureinthankingMr.PushkarAgarwal,Director.
Iwishtoexpressmydeepsenseofgratitudetomyinternalguide,Mr.NaveenMittalforhisableguidanceandusefulsuggestions,whichhelpedmeincompletingtheprojectwork,intime.
Needlesstomentionthatasourceofinspirationandforhistimelyguidanceintheconductofmyprojectwork.IwouldalsoliketothankMr.PankajSharmaforguidingmetomakethisproject.
Wordsareinadequateinofferingmythankstotheprojectassistants,MICIfortheirencouragementandcorporationincarryingouttheprojectworkialsothankallthestaffmembersofourinstituteandtechniciansfortheirhelpinmakingthisprojectasuccessfulone.
Finally,yetimportantly,iwouldliketoexpressmyheartfeltthankstomybelovedparentsfortheirblessings,myfriends/classmatesfortheirhelpandwishesforthesuccessfulcompletionofthisproject.
-
Banking
MICIPage6
LinkedListsLinkedlistsandarraysaresimilarsincetheybothstorecollections
ofdata.Theterminologyisthatarraysandlinkedlistsstore"elements"onbehalfof"client"code.Thespecifictypeofelementisnotimportantsinceessentiallythesamestructureworkstostoreelementsofanytype.Onewaytothinkaboutlinkedlistsistolookathowarraysworkandthinkaboutalternateapproaches.
WhatLinkedListsLookLikeAnarrayallocatesmemoryforallitselementslumpedtogetherasoneblockofmemory.Incontrast,alinkedlistallocatesspaceforeachelementseparatelyinitsownblockofmemorycalleda"linkedlistelement"or"node".Thelistgetsisoverallstructurebyusingpointerstoconnectallitsnodestogetherlikethelinksinachain.Eachnodecontainstwofields:a"data"fieldtostorewhateverelementtypethelistholdsforitsclient,anda"next"fieldwhichapointerisusedtolinkonenodetothenextnode.Eachnodeisallocatedintheheapwithacalltomalloc(),sothenodememorycontinuestoexistuntilitisexplicitlydeallocatedwithacalltofree().
ThisdrawingshowsthelistbuiltinmemorybythefunctionBuildOneTwoThree()(thefullsourcecodeforthisfunctionisbelow).Thebeginningofthelinkedlistis
-
Banking
MICIPage7
storedina"head"pointerwhichpointstothefirstnode.Thefirstnodecontainsapointertothesecondnode.Thesecondnodecontainsapointertothethirdnode,andsoon.Thelastnodeinthelisthasits.nextfieldsettoNULLtomarktheendofthelist.Codecanaccessanynodeinthelistbystartingattheheadandfollowingthe.nextpointers.Operationstowardsthefrontofthelistarefastwhileoperationswhichaccessnodefartherdownthelisttakeslongerthefurthertheyarefromthefront.This"linear"costtoaccessanodeisfundamentallymorecostlythentheconstanttime[]accessprovidedbyarrays.Inthisrespect,linkedlistsaredefinitelylessefficientthanarrays.Drawingssuchasaboveareimportantforthinkingaboutpointercode,somostoftheexamplesinthisarticlewillassociatecodewithitsmemorydrawingtoemphasizethehabit.Inthiscasetheheadpointerisanordinarylocalpointervariable,soitisdrawnseparatelyonthelefttoshowthatitisinthestack.Thelistnodesaredrawnontherighttoshowthattheyareallocatedintheheap.
TypesOfLinkedList
Therearethreetypesoflinkedlist
(a)Singlylinkedlist
(b)Doublylinkedlist
(c)Circularlinkedlist
SinglylinkedlistInthistypeoflinkedlist,eachnodecontainstwofieldsi.e.dataandalinkpointingtothenextnodeinthelist.
SINGLYLINKEDLIST
Thefirstnodeinthelistpointedbythestartpointer.ThelastnodeinthelisthasalinkpointerfieldcontainingaXornull,indicatingendoflist.10,3,and4are
100
NullNode
x4104310210
-
Banking
MICIPage8
thedataitemsandthelinksarerepresentedbyarrows.Theitemsandthelinkpointercombinedtogetherarecallednode.
DoublyLinkedListInthistypeoflinkedlist,eachnodecontainsdataandtwolinks,onelinkpointingtothepreviousnodeandonelinkpointingtothenextnode.Supposeweareinthemiddleofalinkedlistandwewanttodosomeoperationwiththepreviousnode,thenwehavenowaytogotopreviousnode.Itmeans,wewillagaintraversefromstartingnode.Sothisisadrawbackofsinglylinkedlist.Howeverdoublylinkedlistcanbetraversedforwardaswellasbackward.
DOUBLYLINKEDLIST
inthedoublylinkedlist10,20,30arethevaluesofthedatafieldandlinksarerepresentedbytheforwardarrowsorarrowsinthereversedirection.Ineachnode,therearetwolinks,onerepresentstheaddressofpreviousitemandtheotherthatofthenextitem.NullrepresentstheNullpointersaremaintained.Whentraversingthelistfromthelefttoright.
CircularLinkedListoneoftheshortcomingofalinearsinglylinkedlististhathavingreachedtothepreviousnodeunlesstheaddressisavailable.Alsotoreachthefirstnodeafterreachingthe,therewillbeaneedtotraversethewholelistbackwardifpointerareavailable.Supposewemakeasmallchangeinthestructureofalistsothattheaddressfieldofthelastnodeinthelistisnotnull,butitistheaddressofthefirstnodeofthelist.Thenwehaveacircularlist.Insuchastructure,
100
10420102 10010X 102 30 X
100 102104
LeftLink
Start
NullRightLinkNull
-
Banking
MICIPage9
wecanreachanynodefromanyothernodeinthelistbymovingfromoneendtoanotherend.
CIRCUARLINKEDLIST
WhyLinkedListsAreGreatToStudyLinkedlistsholdaspecialplaceintheheartsofmanyprogrammers.Linkedlistsaregreattostudybecause.
NiceDomainThelinkedliststructureitselfissimple.Manylinkedlistoperationssuchas"reversealist"or"deletealist"areeasytodescribeandunderstandsincetheybuildonthesimplepurposeandstructureofthelinkedlistitself.
ComplexAlgorithmEventhoughlinkedlistsaresimple,thealgorithmsthatoperateonthemcanbeascomplexandbeautifulasyouwant.It'seasytofindlinkedlistalgorithmsthatarecomplex,andpointerintensive.
PointerIntensiveLinkedlistproblemsarereallyaboutpointers.Thelinkedliststructureitselfisobviouslypointerintensive.Furthermore,linkedlistalgorithmsoftenbreakandreweavethepointersinalinkedlistastheygo.Linkedlistsreallytestyourunderstandingofpointers.
VisualizationVisualizationisanimportantskillinprogramminganddesign.Ideally,aprogrammercanvisualizethestateofmemorytohelpthinkthroughthesolution.EventhemostabstractlanguagessuchasJavaandPerlhavelayered,referencebaseddatastructuresthatrequirevisualization.Linkedlistshaveanaturalvisualstructureforpracticingthissortofthinking.It'seasytodrawthestateofalinkedlistandusethatdrawingtothinkthroughthecode.
-
Banking
MICIPage10
DynamicalItisnotnecessarytoknowinadvancethenumberofelementstobestoredinthelinkedlistandtherefore,neednottobeallocatememorybeforehand.Memorycanbeallocatedasandwhennecessary.Bythistechniquememoryisallocatedandreleasedtothesystemduringtheexecutionoftheprogramratherthanfixedinadvance.ThemechanismtoallocatememorydynamicallyisprovidedbythestandardClibraryfunctionmalloc().
EasyManipulationInthelinkedlist,insertionsanddeletionscanbehandledefficientlywithoutfixingthesizeofthememoryinadvance.
MemoryefficientAnimportantadvantageoflinkedlistoverarraysisthatthelinkedlistusesexactlyasmuchmemoryasitneeds,andcanbemadetoexpandtofillallavailablememorylocationsifneeded.Thesizeofanarrayisfixedwhenitiscreated.Inlinkedlisttheindividualitemdonotneedtobelocatedcontinuouslyinmemory,thewayarrayelementsare,theycanbescatteredanywhereinthememory.
Nottoappealtoyourmercenaryside,butforalloftheabovereasons,linkedlistProblemsareoftenusedasinterviewandexamquestions.Theyareshorttostate,andhavecomplex,pointerintensivesolutions.Noonereallycaresifyoucanbuildlinkedlists,buttheydowanttoseeifyouhaveprogrammingagilityforcomplexalgorithmsandpointermanipulation.Linkedlistsaretheperfectsourceofsuchproblems.
DisadvantagesOfLinkedList
Disadvantagesoflinkedlistare
Themaindisadvantageofusingalinkedlististhatyoulosetherandomaccessordirectaccesscapabilitytoavalueinthelist.Tofindagivenvalueyouhavetotraversethelist,whichtakesmoretimethananarray.Onedisadvantageofalinkedlististhatyoucannottraverseitbackwards.Tomitigatethisissue,youcanuserecursiveprogrammingoryoucanbuildadoublylinkedlist,atthecostofmorestorageandmoreprocessing.A
-
Banking
MICIPage11
common,nonrecursive,nondoublylinked,algorithmtosearchanodeandmanipulateitistowalkthroughthelistkeepingtwopointers,onetothenodeinquestion,andonetothepriornode
Anotheradvantageofarraysinaccesstimeisspeciallocalityinmemory.Typicallyarraysaredefinedascontiguousblocksofmemory,andsoanyarrayelementwillbephysicallynearitsneighbors.ThisgreatlybenefitsfrommodernCPUcachingmethods.
Adoublylinkedlistisbetterthananarrayforinsertionsanddeletionssinceeachnodehasareferencetoitsprecedingandproceedingsnodes.Therefore,simplychangingthosereferencesisallthat'sneeded.Witharrays,youmustshiftalltheelementsaftertheindexofinsertion.Thus,there'sasignificantdifferenceinalgorithmcomplexity,resultinginlongerruntimeswhenusingarrays.
Linkedlistsareslowerforsearchingsincenodesareusuallylocatedatrandomplacesinmemory,unlikearrayselements,whicharesequentiallyordered.
Traversalistimeconsumingasyouhavetostartfromthefirstnodeeverytimealsoyoucannotgobacktothepreviousnode,youhavetostartalloveragain,caremustbetakentoinsertordeleteaitemfromthemiddle,anodetakesmoresizethandata[tostoreadditionalpointersetc.
LinkedlisthavelotofdisadvantagesandthemainbeinginmostprogrammingenvironmentLinkedlistsareallocatedinHeapwhichwillbecostlyconsideringperformancewhereasarraysareallocatedinstackwhichwillbefast.MaintenanceoverheadwithLinkedlistishugecomparingarrays.
Increasedoverheadforstoringpointerstolinkingthedataitems.
Linkedlistallowonlysequentialaccesstoelementswhilearraysallowrandomaccess.Linkedlistrequiresanextrastrongforreferences,whichoftenmakesthemimpracticalforlistsofsmalldataitemssuchascharactersorBooleanvalues.
-
Banking
MICIPage12
Banking SystemDefinitionofbanking"Thebankundertakestoreceivemoneyandtocollectbillsforitscustomer'saccount.Theproceedssoreceivedarenottobeheldintrustforthecustomer,butthebankborrowstheproceedsandundertakestorepaythem.Thepromisetorepayistorepayatthebranchofthebankwheretheaccountiskept,andduringbankinghours.Itincludesapromisetorepayanypartoftheamountdueagainstthewrittenorderofthecustomeraddressedtothebankatthebranch.....Bankersneverdomakeapaymenttoacustomerinrespectofacurrentaccountexceptupondemand."
WhatIthinkiscommontoallmoderndefinitionsofbankingandessentialtothecarryingonofthebusinessofbankingisthatthebankershouldacceptfromhiscustomersloansofmoneyondeposit,thatistosay,loansforanindefiniteperiodonrunningaccount,repayableastothewholeoranypartthereofondemandbythecustomer...."
Functionsofbank
1. Createanaccount2. Depositmoney3. Withdrawmoney4. Editthedetailsofanycustomer5. Viewaccountstatusofanycustomer6. Getviewofallcustomerdetails7. Deleteanycustomerdetails8. Transfermoneyfromoneaccounttoanother9. Provideloanstocustomers10.Providingmanyfinancialbenefitstocustomers.Etc.
-
Banking
MICIPage13
ABOUTPROJECTTheprojectisbasicallymadetoexecutethebankingfunctions.Byusingthisprojectwecancreateanaccountaccordingtotheusersrequirementsay,ifuserisrelatedtoanybusinessandneedtodepositandwithdrawmoneydaily,customercanopenacurrentaccount.Ifuserwantstoopenanaccounttosavemoneyforthefuturehe/shecanopenasavingaccount.
Thisprogramisalsohelptomanipulatetheusersaccountslike,ausercandepositmoneyontheotherhandusercanalsowithdrawmoney.Byusingthisprogramausercanviewthedetailsofanycustomer.Thisprogramalsoprovidesthefacilitytoremoveentriesfromtherecordslist.
Headerfilesusedintheprogram Stdio.h Conio.h String.h Stdlib.h Stdio.h:Thisheaderfileisusetooperateinputoutput
functions.printf(),scanf()etcfunctionsusedinthisprogramaredefinedintheheaderfilestdio.h.
Conio.h:Thisheaderfileisusedtohendletheoutputoftheprogram.Functionsusedinthisprogramlikegetch(),clrscr()aredefinedinthisheaderfile.
String.h:Thisheaderfileisusedtooperatethestrings.Functionsusedinthisprogramlikestrcmp(),strcpy()aredefinedintheheaderfilestring.h.
-
Banking
MICIPage14
Stdlib.h:Thisheaderfileisalsoknownasstandardlibrary.Thisheaderfileprovidesfunctionslikemalloc(),
calloc(),andalsoexitetc,whichareusedinthisprogram.
Methodsusedintheprogramdmenu()dadd()dfind()dedit()ddel()ddisp()ddisp1()ddisp2()dwith()ddepo()dcurrent_with()dcurrent_depo() deposit() withdrawal()
dmenu():Thismethodisusedtodisplayallmenustotheuser.Thishelpsusertochoosetheoptionaccordingtotheirrequirement.
Themenuwillbeasfollows
-
Banking
MICIPage15
oVariablesIntegertypevariabledchtostoretheuserschoicefromthemenu.
oFunctionsprintf():Thismethodprintsthemessageonthescreen.scanf():thisfunctionretrievesthevaluegivenbytheusergotoxy().Thismovesthecursortothegivenpositioninthecurrentwindow.
oReturnvalueThismethodreturnsonevaluewhichisthechoiceoftheuser.
Dadd() : thismethodidsusedtoaddnewnodeindatastructuretostorenewrecord.Firstlyuserneedtoenterweathertheyaregoingtoopenasavinga/coracurrenta/c.
BANKINGDATABASE ================
1.Createanewaccount
2.Searchcustomerdetails
3.Editcustomerdetails
4.Deleteacustomer
5.Displayallaccountholders
6.Depositmoney
7.Withdrawalmoney
8.BalanceEnquiry
9.Exit
Enteryourchoice(19):
-
Banking
MICIPage16
ThismethodneedssomeentrieslikeFirstName,LastName,TelephoneNumber,Depositsum.
oVariables:inttypenode*dptr,*dprevtypevariableisusedtocheckwhetheruserwantstocreateasavinga/corcurrenta/c.*dptr,*dprevisusedtostorethememorylocationstonextandthepreviousnodes.
oFunctions:malloc().Thisfunctionisusedtoallocatethememoryatruntime.
oConditionsnloops:inthismethodweusedif()..elsestatement.tocheckconditionforsavingorcurrenta/c.do{..}while()loop:thisloopiteratestheblockuntil1000entries.
oInthismethodwithinthecolumnofdepositamountiftheuserenterstheamountbelowRs.500itwilldisplayanerrormessageINSUFFICIENTFUND.SouserneedtofillamountaboveRs.500.
Dfind():thismethodfacilitatesusertofindtheinformationaboutanycustomer.Byenteringa/cnumberusercanviewthedetailsofcustomer.
Whichtypeofaccountyouwanttocreate?
1>Savings
2>Current
enteryourchoice:
-
Banking
MICIPage17
Variables:node*dptrtostoretheofnextnode.intno,numnoisusedtoretrievethea/cnoofthecustomerandnumistochecktherangeoftheaccounts.
Thismethoddisplaysalltheinformationaboutthecustomerlikeaccountnumber,firstname,lastname,telephonenumber,balance.
Thismethodfetchesvaluesfromthenodes,wherenodesstoresthevalueswhicharespecifiedinthestructure.
Dedit():Thismethodismadetoeditthedatastoredinthelinkedlistsnodes.Thismethodworksuponthebasesoftheaccountnumber,whoseaccountnumberisenteredbytheuser.
oIfuserentersanaccountnumberwhichdoesnotexistintheolistthenthismethoddisplaysamessage.oIfthedatabasedoesnotcontainsanyrecordi.e.ifthefirst
pointercontainsthevalueNulltheitdisplaysthemessagethat,listcontainsnorecord.
HELLORamWELCOMETOOURBANKYouareaSAVINGSaccountholderofourbankAccountnumber:5001Firstname:RamLastname:KapoorTelephoneNo.:1234567890YourBalance:2500
-
Banking
MICIPage18
oIftheuserwantstoedittheaccountbalance,itshouldberememberbytheuserthatamountshouldbemorethanRs500otherwiseitwillbeanerrormessageofinsufficientfund.
Ddel():Thismethoddeletesthecustomersaccountsaccordingtotheusersrequirement.Thefollowingpointsworkwhendeletingarecord
EnternumbertoEdit:5000
HELLOKapoorWELCOMETOOURBANK
OldFirstName:Ram
NewFirstName:Raj
OldLastName:Kapoor
NewLastName:Singh
PhoneNumber:123654
NewPhoneNumber:9632587410
OldBalance:4500
NewBalance:6000
Enteryouraccountnotodelete:5000
DeletingRecord.....Confirm[y/n]:
-
Banking
MICIPage19
oThefirstnodewouldnotbeNull,ifthefirstnodisnullitmeansthatthereisnorecordinthelinkedlisttodelete.
oThismethodworksontheaccountnumberofthecustomer,souserneedtoenterthecustomersaccountnumber.
Ddisp() : Thismethoddisplaysrecordsofallcustomersofthebank,whohaveaccountsinbankwhetheritsisasavinga/coracurrentaccount.Thismethodisbasicallyusedtodisplaythebasicdetailsofthe
user.
Ddisp1() : Thismethodissameasddisp()exceptthat,ddisp()methodprintsthebasicdetailsofthecustomerbutthismethodalsoshowswhetherthecustomerisasavingaccountholderoracurrentaccountholder.
Customerdetails
HELLOKapoorWELCOMETOOURBANK
Accountnumber:5000
Firstname:Ram
Lastname:Kapoor
TelephoneNo.:1236547895
YourBalance:5555
Customerdetails
HELLOKapoorWELCOMETOOURBANK
Youareasavingaccountholderofourbank
Accountnumber:5000
Firstname:Ram
Lastname:Kapoor
TelephoneNo.:1236547895
YourBalance:5555
-
Banking
MICIPage20
Ddisp2() :Thismethodisdifferfromtheabovetwomethodsintheway,thatthismethoddisplaysthattheuserisacurrentaccountholder.Outputisasfollows.
Ddepo() : Whenuwanttodepositmoneyinyoursavingaccountthattimethismethodtakesplaceintheprogram.
oThismethodputsthevalueinthedefinednodesvariablewhichhasstoredthevalueofthedepositamount
Dwith() : Thismethodworkswhenyouaregoingtowithdrawamountfromyoursavingaccount.
Customerdetails
HELLOKapoorWELCOMETOOURBANK
Youareacurrentaccountholderofourbank
Accountnumber:5000
Firstname:Ram
Lastname:Kapoor
TelephoneNo.:1236547895
YourBalance:5555
EntertheaccountNo:5000HELLOKapoorWELCOMETOOURBANKAccountNo:5000FirstName:ramLastName:KapoorPhoneNumber:123454453YourBalance:1500WithdrawalAmount:2000INSUFFICIENTFUNDAminimumofRs.500/shouldbemaintainedWithdrawalAmount:
-
Banking
MICIPage21
oThismethodlessthewithdrawalmoneyfromtheusersaccounti.e.accountdefinedbythenodefromwhichuserwantstowithdrawtheamount.
o Ifthewithdrawalamountismorethanthebalancingamountofthecustomersaccount,thattimetheprogramprintsamessageagainsttheuserthatINSUFFICIENTFUNDAminimumofRs.500/shouldbemaintained
Dcurrent_depo() : Thismethodissameasddepo()methodbutthismethodworksforthecurrentaccountholders.Whenuserwantstowithdrawmoneyfromthecurrentaccountthattimethismethodtakesplace.
Dcurrent_with() :thismethodwithdrawsmoneyfromthecurrentaccount.Thismethodalsoworksinsamemanner,saywhenuserwantstowithdrawmoneyprogramasktheaccountnumberandgotothatnodeandlesstheamountfromtheaccount.
Deposit(): whenusergivecommandtodepositmoneyfromthespecificaccountfirstofallthismethodhasbeencalled.Whenthecontrolmovedtothismethoditcheckswhatkindofaccountholderthecustomeris.If
-
Banking
MICIPage22
thecustomerisasavingaccountholderthenthismethodpassthecontroltotheddepo()method,elseitpassthecontroltothedcurrent_depo()method.Thefurtherworkishandledbythesemethodswhichwehavedefinedearlier.
Withdrawl():whenuserwantstowithdrawmoneyfromthespecificaccount,firstofallthismethodhasbeencalled.Whenthecontrolmovedtothismethoditcheckswhatkindofaccountholderthecustomeris.Ifthecustomerisasavingaccountholderthenthismethodpassthecontroltothedwith()method,elseitpassthecontroltothedcurrent_with()method.Thefurtherworkishandledbythesemethodswhichwehavedefinedearlier.
-
Banking
MICIPage23
Sourcecode
#include#include#include#includeintdmenu()//mainmenuvoiddadd()//addtolistvoiddfind()//searchfromthelistvoiddedit()//edittherecordvoidddel()//deletefromthelistvoidddisp()//displayallvoidddisp1()voidddisp2()voiddwith()voidddepo()voiddcurrent_with()voiddcurrent_depo()voiddeposit()voidwithdrawal()structdnode{intnum,bal,checkchardlname[20],dfname[20],dtel[15]structdnode*dnext}
typedefstructdnodenodenode*dstart,*dtempinti=5000,chk=1,j=15000intdmenu(){intdch
gotoxy(30,5)
-
Banking
MICIPage24
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
-
Banking
MICIPage25
node*dptr,*dprevdtemp=(node*)malloc(sizeof(node))printf("\nWhichtypeofaccountyouwanttocreate?\n1>Savings\n2>Current\nenteryourchoice:")scanf("%d",&type)if(type==1){do{printf("\nYourAccountNo:")dtemp>num=iprintf("%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>baldnext=NULLif(dstart==NULL)dstart=dtempelse{dprev=dptr=dstartwhile(strcmp(dtemp>dfname,dptr>dfname)>0)
-
Banking
MICIPage26
{dprev=dptrdptr=dptr>dnextif(dptr==NULL)break}if(dptr==dprev){dtemp>dnext=dstartdstart=dtemp}elseif(dptr==NULL)dprev>dnext=dtempelse{dtemp>dnext=dptrdprev>dnext=dtemp}}ddisp1()}elseif(type==2){do{printf("\nYourAccountNo:")dtemp>num=jprintf("%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:
-
Banking
MICIPage27
printf("DepositSum:")scanf("%d",&dtemp>bal)if(dtemp>baldnext=NULLif(dstart==NULL)dstart=dtempelse{dprev=dptr=dstartwhile(strcmp(dtemp>dfname,dptr>dfname)>0){dprev=dptrdptr=dptr>dnextif(dptr==NULL)break}if(dptr==dprev){dtemp>dnext=dstartdstart=dtemp}elseif(dptr==NULL)dprev>dnext=dtempelse{dtemp>dnext=dptrdprev>dnext=dtemp}}printf("YourprovidedChequenos.%dto%d",chk,chk+19)ddisp2()
}}
voiddfind()
-
Banking
MICIPage28
{node*dptrintno,numif(dstart==NULL){printf("\n\t\t\tNOACCOUNTDATABASE....\n")getch()return}printf("EntertheaccountNo:")scanf("%d",&no)dptr=dstartwhile(dptr>num!=no){dptr=dptr>dnextif(dptr==NULL)break}if(dptr!=NULL){if(dptr>num>=5000&&dptr>numnum==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")
-
Banking
MICIPage29
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=1printf("\n\t\tChequenos:%dto%d",chk,chk+19)printf("\n\t\t\n")}}}else{printf("NoMatchingRecordsFound.......\n")}getch()}
voiddeposit(){intnonode*dptr,*dprevif(dstart==NULL){printf("\n\t\t\tNOACCOUNTDATABASE....\n")getch()return}printf("Enteryouraccountno:")scanf("%d",&no)
-
Banking
MICIPage30
dptr=dstartwhile(dptr>num!=no){
dptr=dptr>dnextif(dptr==NULL)break}if(dptr!=NULL){if(dptr>num>=5000&&dptr>numdlname)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)
-
Banking
MICIPage31
dptr>bal+=balprintf("YourNewbalance:%d",dptr>bal)getch()}
voiddcurrent_depo(){node*dptrintbal,chprintf("\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\nEnteryourchoice:")scanf("%d",&ch)if(ch==1){printf("DepositAmount:")scanf("%d",&bal)dptr>bal+=balprintf("YourNewbalance:%d",dptr>bal)}elseif(ch==2){do{printf("\nYourCheckNo:")dtemp>check=chkprintf("%d\n",dtemp>check)chk++}while(chk>21)printf("DepositAmount:")
-
Banking
MICIPage32
scanf("%d",&bal)dptr>bal+=balprintf("YourNewbalance:%d",dptr>bal)
}getch()}
voidwithdrawal(){node*dptrintnoif(dstart==NULL){printf("\n\t\t\tNOACCOUNTDATABASE....\n")getch()return}printf("EntertheaccountNo:")scanf("%d",&no)dptr=dstartwhile(dptr>num!=no){dptr=dptr>dnextif(dptr==NULL)break}if(dptr!=NULL){if(dptr>num>=5000&&dptr>num
-
Banking
MICIPage33
}else{printf("NoMatchingRecordsFound.......\n")}getch()}
voiddwith(){node*dptrintbalprintf("\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)bal=balprintf("YourNewbalance:%d",dptr>bal)getch()}
voiddcurrent_with()
-
Banking
MICIPage34
{node*dptrintno,bal,chprintf("\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\nEnteryourchoice:")scanf("%d",&ch)if(ch==1){b:printf("WithdrawalAmount:")scanf("%d",&bal)
if((dptr>balbal)bal=balprintf("YourNewbalance:%d",dptr>bal)}
elseif(ch==2){do{printf("\nYourCheckNo:")dtemp>check=chkprintf("%d\n",dtemp>check)
-
Banking
MICIPage35
chk++}while(chk>21)c:printf("WithdrawalAmount:")scanf("%d",&bal)
if((dptr>balbal)bal=balprintf("YourNewbalance:%d",dptr>bal)}getch()}
voiddedit(){node*dptrintno,balif(dstart==NULL){printf("\n\t\t\tNOACCOUNTDATABASE....\n")getch()return}printf("EnternumbertoEdit:")scanf("%d",&no)dptr=dstartwhile(dptr>num!=no){dptr=dptr>dnextif(dptr==NULL)break
-
Banking
MICIPage36
}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(balbal=bal}else{printf("NoMatchingRecordsFound.......\n")}getch()}
voidddel(){node*dptr,*dprev,*dtempintno
-
Banking
MICIPage37
chardyn='n'if(dstart==NULL){printf("\n\t\t\tNOACCOUNTDATABASE....\n")getch()return}printf("Enteryouraccountnotodelete:")scanf("%d",&no)dprev=dptr=dstartwhile(dptr>num!=no){dprev=dptrdptr=dptr>dnextif(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>dnextfree(dstart)dstart=dtemp}else{dtemp=dptr>dnextfree(dptr)dprev>dnext=dtemp
-
Banking
MICIPage38
}printf("\n\n1RecordDeleted....")}elseprintf("\n\nRecordnotDeleted....")}else{printf("\nNoMatchingRecordsFound.......")}getch()}
voidddisp(){node*dptrif(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()}
-
Banking
MICIPage39
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=1printf("\n\t\tChequenos:%dto%d",chk,chk+19)printf("\n\t\t\n")getch()}voidmain(){intdch
-
Banking
MICIPage40
dstart=(node*)malloc(sizeof(node))
dstart=NULLdo{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)}
-
Banking
MICIPage41