Sie sind auf Seite 1von 5

BankingReport ACreditCardReportistobeprepared.TheinputconsistsofCreditCardDiskRecordscontainingthe BranchCode,AccountNumber,CreditLimit,PreviousBalance,TransactionDate(inMM/DD/YYformat), TransactionCode(1=Payment,2=Credit,3=Charge),andTransactionAmount.Theinputrecordsare sortedbyTransactionDatewithinAccountNumberwithinBranchCodepriortoprocessing.

Theformat oftheinputrecordisillustratedbelow: CreditCardDiskRecord Position Length 2 12 8 310 6 1116 6 1722 8 2330 1 31 6 3237 37

FieldDescription BranchCode AccountNumber CreditLimit PreviousBalance TransactionDate TransactionCode TransactionAmount RecordLength

Decimal 0 2 2 0 2

Attribute Numeric Alphanumeric Numeric Numeric Alphanumeric Numeric Numeric

OutputconsistsofaCreditCardReportlistingallcreditcardholdersforthebank,tobestoredinafile. Theprinterspacingchartisillustratedonaseparatepage.ThereportcontainstheBranchName, AccountNumber,PreviousBalance,TransactionDate,TransactionType,TransactionAmount,andNew Balance. TheBranchNameshouldbeextractedfromanotherinputfilebasedupontheBranchCodeintheinput record.TheBranchNametableappearsbelow. Branch Code 01 17 39 Branch Name TheMall ModelTown Gulberg

IftheBranchCodefromtheinputrecordisnotfoundintheBranchNametable,thenthemessage UNKNOWNshouldbeprintedontheoutputreportintheBranchNamefield.TheTransactionTypeon thereportshouldbeextractedfromafilebasedupontheTransactionCodeintheinputrecord.The TransactionTypetable(anotherfile)appearsbelow. Transaction Code 1 2 3 Transaction Type Payment Credit Charge

InadditiontothethreeTransactionTypesthatappearonthereport,everyaccountischargedaFinance Charge.TheFinanceChargeshouldappearontheCreditCardReportasthelasttransactionforthe AccountNumberbeingprocessedandshouldappearwiththeTransactionDateleftblank,thewords FinanceChargeprintedintheTransactionTypefield,andtheamountoffinancechargeprintedinthe TransactionAmountfield.TocalculatetheFinanceCharge,theAmountOwedmustbedetermined.The AmountOwediscalculatedbysubtractingTotalPaymentsandTotalCreditsfromthePreviousBalance. TheFinanceChargeisthencalculatedbymultiplyingtheAmountOwedbytheappropriateinterestrate fromthefollowingtable(anotherfile). Amount Owed UnderRs.1,000 Rs.1,000Rs.2,500 OverRs.2,500 Interest Rate 1.65% 1.55% 1.40%

TheNewBalanceofthefirsttransactionwithinanaccountiscalculatedbysubtractingtheTransaction AmountfromthePreviousBalanceifthetransactionisaPaymentoraCredit,andaddingthe TransactionAmounttothePreviousBalanceifthetransactionisaCharge.AllotherNewBalancesare calculatedbysubtractingtheTransactionAmountfromthePreviousNewBalanceifthetransactionisa PaymentoraCredit,andaddingtheTransactionAmounttothePreviousNewBalanceifthetransaction isaCharge. UponachangeintheAccountNumberintheinputrecord,anAccountSummaryistobeprinted.The summaryforthataccountcontainsthePreviousBalance,TotalPayments,TotalCredits,TotalCharges, FinanceCharge,andNewBalance.Inaddition,theCreditLimit(whichappearsineachinputrecord associatedwithanaccountnumber),AvailableCredit,andMinimumPaymentaretobeprinted.The AvailableCreditiscalculatedbysubtractingtheNewBalancefromtheCreditLimit. TheMinimumPaymentiscalculatedaccordingtotheinstructionsinthefollowingtable(notafile,just rules). IfNewBalanceis UnderRs.10 Rs.10toRs.250 OverRs.250 MinimumPayment AmountofNewBalance Rs.10plus5%oftheNewBalance Rs.25plus7%oftheNewBalance

Thus,iftheNewBalanceisRs.7,theMinimumPaymentisRs.7.IftheNewBalanceisRs.200,thenthe MinimumPaymentisRs.20(Rs.10+(5%xRs.200)).IftheNewBalanceisRs.400,theMinimum PaymentisRs.53(Rs.25+(7%xRs.400)). AllthetransactionsforoneaccountandthecorrespondingAccountSummaryshouldappearona separatefilebythemselves.

Aftertheprocessingofallaccounts,aBankSummaryshouldbestoredinaseparatefile.Thesummary shouldcontaintheTotalPreviousBalancesforallaccounts,TotalPayments,TotalCredits,TotalCharges, andTotalNewBalancesofallaccounts. Youarealsorequiredtoprovideamenutoperformthefollowingoperations. 1. 2. 3. 4. 5. PRINTreport ADDmorerecords DELETEarecord EDITarecord EXIT Asdescribedabove Toaddmorerecordsinthemaintransactionfile Toremove/markexistingrecordsfrommainfile Toupdateanexistingrecordfromthemainfile Toterminateyourapplication

Theoption3and4mentionedaboverequiressearchingofarecordasdesiredbytheuser.Bothoptions mustdisplaytheexistingrecordonsuccessfulsearchoperation. Sampledataisalsogivenonaseparatepage. Note:Keepyourwholecodeproperlyindented.Useunderstandableidentifiernames.Writecomments atalltheimportantpointsinyourcodesothatyourcodemaybeunderstoodeasily,evenforevaluation. Youarealsorequiredtowriteasummaryofhowdoesyourprogramworksinthestartofyourcode.If yourcodehasmultipleprogramfiles,writethenamesandidsofyourgroupmembersinthestartof eachprogramfile.

Das könnte Ihnen auch gefallen