Pop Quiz 3 2019 soln - Pop Quiz with solutions - computer concepts and applications PDF

Title Pop Quiz 3 2019 soln - Pop Quiz with solutions - computer concepts and applications
Author LN Schild
Course Comput Concepts & Applic
Institution Tulane University
Pages 4
File Size 120.4 KB
File Type PDF
Total Downloads 84
Total Views 138

Summary

Pop Quiz with solutions - computer concepts and applications...


Description

BMEN/ENGP 2020 Pop Quiz 3 Solutions Thursday, March 21, 2019 1. The value, Bann , of a savings account of an amount A that is deposited for t years with an interest rate of r that is compounded annually is given by: Bann = A (1 + r)t The value Bmon of a savings account of an amount A that is deposited for t years with an interest rate of r that is compounded monthly is given by:  r nt Bmon = A 1 + n where n is the number of times per year the interest is compounded. In this case, n is 12. The value, Bcon , of a savings account of an amount A that is deposited for t years with an interest rate of r that is compounded continuously is given by: Bcon = Aert Here, r is the decimal representation of a percent − so, for instance, an interest rate of 1% is equivalent to r = 0.01. (a) Write a MATLAB script that asks the user to enter the value of the initial deposit, A, as well as the number of years that the interest will accrue, t. Check to make sure A is a positive number and that t is a positive integer. (b) Calculate the balances Bann , Bmon and Bcon after t years for an initial deposit of A and interest rates ranging from 0.25% to 10% with increments of 0.25%. (c) Display the results as a table in the Command Window. The table should have four columns where the first column displays the interest rate and the second, third, and fourth columns display the corresponding values of Bann , Bmon and Bcon , respectively. The interest rates as well as all of the balances should have 2 decimal digits. (d) Print this table to a file called Quiz 3 email.txt, where email is your Tulane email before the @ symbol. Here is a sample run of the program: What i s t h e i n i t i a l b a l a n c e on s a v i n g s a c c ou n t ? 15000 What i s t h e number o f y e a rs i n t e r e s t w i l l a c c ru e ? 20 RATE (%) BALANCE ( ann ) BALANCE (mon) BALANCE ( con ) 0. 2 5 $ 157 68 . 08 $ 157 68 . 98 $ 157 69 . 07 0. 5 0 $ 165 73 . 43 $ 165 77 . 22 $ 165 77 . 56 0. 7 5 $ 174 17 . 76 $ 174 26 . 70 $ 174 27 . 51 1. 0 0 $ 183 02 . 85 $ 183 19 . 52 $ 183 21 . 04 ... 9.50 $ 9 2 12 4. 18 $ 9 9 54 0 .9 2 $100288 . 4 2 9.75 $ 9 6 42 3 .2 7 $ 104602 . 8 7 $105430 . 3 1 1 0 .0 0 $100912 . 5 0 $109921 . 1 0 $110835 . 8 4 For bonus points: See next page.

For bonus points: (a) Plot the balance Bann versus the interest rate r using a red dotted line with red diamond markers, Bmon versus the interest rate r using a green dashed line with green square markers, and the balance Bcon versus the interest rate r using a blue solid line with blue circle markers. All three graphs should be in one plot. (b) What is the interest rate when Bcon − Bann is more than $5000 AND less than $6000? You will not get points by solving it yourself. You have to actually write MATLAB code to find the answer. Hint: use the matrix you created to print out the table. Code: Comments have been added to explain the code. %====================================================== % Quiz 3 Problem : 1 % Key Date : 3/21/2019 %−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− % C a l c u l a t e b al a n c e i n s a v i n g s a cco un t %====================================================== clear ; close a l l ; clc ; %d e f i n e number o f months p er yea r as 12 n=12; % Ask u s er t o in p u t i n i t i a l A=i n p u t ( ‘ What i s th e i n i t i a l w h i l e A...


Similar Free PDFs