You are on page 1of 1

EGN1041C

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.

You might also like