Professional Documents
Culture Documents
Final Exam Review - sp15
Final Exam Review - sp15
Finalexamreviewproblem
Spring2015
1. Useawhilelooptodeterminehowmanytermsintheseries2k,k=1,2,3,.,arerequiredfor
thesumofthetermsofexceed2000.Whatisthesumforthisnumberofterms?
2. Usealooptodeterminehowlongitwilltaketoaccumulate$1,000,000inabankaccountifyou
deposit$10,000initiallyand$10,000attheendofeachyear;theaccountpays6percentannual
interest.
3. UsetheswitchstructuretowriteaMATLABprogramtocomputetheaccountofmoneythat
accumulatesinasavingsaccountinoneyear.Theprogramshouldacceptthefollowinginput:
theinitialaccountofmoneydepositedintheaccount;thefrequencyofinterestcompounding
(monthly,quarterly,semiannually,orannually);andtheinterestrate.Runyourprogramfora
$1000initialdepositforeachcase;usea5%interestrate.
4. ConsiderthearrayA.
A=
33
17
UseaforloopwithconditionalstatementstowriteaMATLABprogramthatcomputesthearray
BbycomputingthenaturallogarithmofalltheelementsofAwhosevalueislessthan1,and
adding20toeachelementthatisequaltoorgreaterthan1.