Python Loops Drill
Instructions: In Python use one or more loops to solve the following exercises. Do not rely on a fancy formula that you find on the intenet -- that would defeat the purpose of the drill. The answers to some of the problems are given below so you can check them against the output of your loop.
Click Kernel above and make sure your Kernel is Python 3(Anaconda 5). You can also use the Kernel menu to restart the kernel if the program jams up. This sometimes occurs if you ask it to execute an incomplete command that never finishes, or an infinite loop.
1.
Compute
(answer )
2.
You deposit $65 on the first business day of each month into a bank account earning 0.24% interest per month. Interest is paid in the on the last business day of each month. Your first deposit is made on Wednesday, Jan. 2, 2019, you make no other deposits or withdrawals except for the deposits mentioned above, and the interest rate never changes. How much will there be in your account
(a) after the interest is paid on Thursday, Dec. 31, 2026?
(answer = $7024.80)
(b) after the interest is paid on Wednesday, July 31, 2030?
(answer = $10,735.18)
3.
On Wed. Jan. 2, 2019 you buy a used car. You agree to pay $9000. You pay a $2000 down payment and finance the rest. Your monthly monthly payments are $150, due on the first business day of each month. Your first monthly payment is due Friday, Feb. 1, 2019. Your last monthly payment will be the amount that you still owe on the car if that amount is less than $150. The finance company charges at 9% annual percentage rate (APR). Assume this means on the last day of each month they charge 1/12 of 9% interest, and the first interest charge occurs on Jan. 30, 2019.
(a) How much will you still owe on the car on Friday, Dec. 31, 2021, after the interest is charged?
(answer $3137.61)
(b) From the day you buy the car how many months will it take to pay off the car?
(c) If you add up your down payment and all your monthly payments how much will you have paid for the car?
4.
A credit union Visa card charges 11.99% annual percentage rate for customers who are in good standing. Assume this means they charge 1/12 of that rate each month. To be in good standing customers who owe money on their cards are required to pay at least a minimum payment each month. According to the credit union the required minimum payment is
3% of your total balance but not less than $25
except if your total balance is less than $25 then you don't pay $25, you just pay off the total balance.
Suppose a customer owes $2500 on his Visa card on Jan. 2, 2019. On the first business day of each month he pays the the minimum payment, and makes no other payments or charges. Interest is charged on the last business day of each month.
(a) How much will the customer owe on his card on Dec, 31, 2021, after the interest for that month is charged?
(answer = $1194.43)
(b) If he keeps making the minimum payment until the balance on the card is paid off, when will he make his last payment?
(hint: first figure out how many months he makes minimum payments that are over $25. Then figure out how many more months it takes to pay off the card. Be sure to include the last payment.)
(c) After he pays off this debt he adds up all the payments that he has made to find out how much it cost to pay off this debt. How much will it have cost to pay off this $2500 debt making minimum payments?
(hint: nearly $3500.)
5.
(For help with this problem see the section on "Approximate Integration" in your Calculus book -- it's section 6.5 in Stewart's Essential Calculus, Second edition.)
Approximate the integral by subdividing the interval into subintervals using
(a) The trapezoid rule:, (a pretty-good approximation formula). If ( a=x_0 < x_1 <x_2 < \cdots < x_n=b ) subdivides ([a,b]) into congruent subintervals of equal length
then
(b) Simpson's rule: (generally this is more accurate than the trapezoid rule). If (n) is even and ( a=x_0 < x_1 <x_2 < \cdots < x_n=b ) subdivides into congruent subintervals of equal length
then