Question1(Marks:60)Youhavedecidedtostartasavingsaccountbecauseyouwouldliketogoonholidaywithafriendandyouneedtokeeptrackofyourdeposits,interestpaid,balanceandtaxliabilities.Yourgoalistosaveforthreemonths.Youhavespentsometimecomparingvarioussavingsoptionsinordertogetthemostgrowthoutofyoursavings.Thatmeansthehighertheinterestrate,themoreyourmoneywillincrease.Thesavingsaccountyouhavechosenoffersthebestinterestrateswhicharebasedonaslidingscaleonthebalanceofyouraccount.VALUEOFSAVINGSACCOUNTBALANCEINTERESTRATE(permonth)LessthanR20002%GreaterthanorequaltoR2000butlessthanR50004%GreaterthanorequaltoR50006%TheSouthAfricanRevenueServices(SARS)willdeduct25%taxoftheinterestpaidintoyouraccounteachmonth(fromtheprofityoumakeeverymonth),i.e.,theinterestpaidtoyou.WritethepseudocodeforthefollowingscenarioanduseCamelCaseforthevariablenames.Theinputintotheprogramwillbe:Accountnumber(numeric)Amountofdeposit(numeric)Month(numerice.g.,‘5’isMay)Theprogrammustdothefollowing:Asktheusertoentertheaccountnumbertwiceandcomparethetwoaccountnumbers.Thisistoensureyouwillmakeyourdepositintothecorrectaccount.Ifthetwoaccountnumbersentereddonotmatch,thendisplayanappropriatemessageandasktheusertore‐enterthetwoaccountnumbersagain.
22;232022©TheIndependentInstituteofEducation(Pty)Ltd2022Page4of6TheminimummonthlydepositisR500.CheckthatthedepositamountisR500ormore.IfitislessthanR500,thentheprogrammustpromptyoutore‐enteranamountuntilyouspecifyanamountofR500ormore.Useacasestructuretoconvertthenumericmonthtoastringmonthname.oE.g.,1willbeJanuary,2willbeFebruary,etc.Checktheaccountbalanceagainsttherangeofvalueswhichdeterminestheinterestrate.Calculatetheinterestpayableandaddtheinteresttoyouraccountbalance.CalculatethetaxduetoSARSanddeductthisfromyouraccountbalance.Printoutabalancestatementeachtimeyoumakeadepositsoyoucankeeptrackofyouraccountbalance.Thebalancestatementmustincludethefollowinginformation:[Thevaluesusedarefordemonstrationpurposesonly.Theusercanenteranyamount]MySavings–AprilOpeningBalanceDepositInterestEarnedSARSR0R500R10R2.50Balance:R507.50MySavings–MayOpeningBalanceDepositInterestEarnedSARSR507.50R1500R80.30R20.08Balance:R2067.72MySavings–JuneOpeningBalanceDepositInterestEarnedSARSR2067.72R1700R150.71R37.68Balance:R3880.75
Question1(Marks:60)Youhavedecidedtostartasavingsaccountbecauseyouwouldliketogoonholidaywithafriendandyouneedtokeeptracko
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am