Question: Please use python three questions are related. Question 1: Please write a program that computes amount based on interest accumulated over time as follows: .

Please use python

three questions are related.Please use python three questions are related. Question 1: Please write aprogram that computes amount based on interest accumulated over time as follows:. Read the following three inputs (in separate statements) and assume that

Question 1: Please write a program that computes amount based on interest accumulated over time as follows: . Read the following three inputs (in separate statements) and assume that the user provides three valid numbers, i.e. no validation is required: principal, interest rate, term (in years) Compute final amount based on simple interest rate as follows: Prt Amount after t years = P + 100' where P = principal, r = interest rate, t = time in years Compute final amount based on compound interest as follows: Amount after t years =P + 100% . A sample run of the program is shown below: (base) C:\temp>python ql.py Please input principal: 1200 Please input interest rate: 4.5 Please input time (in years): 5 Your inputs were: principal = 1200.00, interest rate = 4.50%, time = 5.0 years. Amount, based on simple interest, at the end of 5.0 years is 1470.000 Amount, based on compound interest, at the end of 5.0 years is 1495.418 (base) C:\temp> Question 2: Write two functions named amount_compound_interest(p,r,t) and amount_simple_interest(p,r,t) to calculate amounts as shown in Question 1. Save these two functions in a separate python file called Gwid_mymod.py. Then complete the following program by reading the three numbers as you did in Question 1 and providing the desired output as shown based on the following inputs. . Principal Time (in years) Interest rate Compound interest (C) or Simple interest (S). If the user enters anything other that Cor 1 (upper or lower case allowed), the program should print out Incorrect choice for calculating interest and amount" as shown below: (base) C:\temp>python q2.py Please input principal: 1100 Please input time (in years): 5 Please input interest rate: 4.56 Please input c for compound interest or S for simple interest: d Incorrect choice for calculating interest and amount. (base) C:\temp> (base) C:\temp>python q2.py Please input principal: 1100 Please input time (in years): 5 Please input interest rate: 4.56 Please input C for compound interest or S for simple interest: C Your inputs were: principal = 1100.00, interest rate = 4.56%, time = 5.0 years. Amount, based on compound interest, at the end of 5.0 years is 1374.740 (base) C:\temp> (base) C:\temp>python q2.py Please input principal: 1100 Please input time (in years): 5 Please input interest rate: 4.56 Please input c for compound interest or S for simple interest: s Your inputs were: principal = 1100.00, interest rate = 4.56%, time = 5.0 years. Amount, based on simple interest, at the end of 5.0 years is 1350.800 (base) C:\temp> Question 3: Use the setup of question 2, i.e. the functions amount_compound_interest(p,r,t) and amount_simple_interest(p,r,t) in the module Gwid_mymod.py. Then complete the following program and provide the desired output in the form of a table as shown based on the following inputs. . . t(time, in years) r(Interest rate) Minimum p (principal) Step size for principal Compound interest (C) or Simple interest (S) - assume the user provides correct input, i.e., only C (upper or lower case) or S (upper or lower case) . (base) C:\temp>python 93.py Please input time (in years): 5 Please input interest rate: 5.5 Please input base value for principal: 1000 Please input step value for principal: 100 Please input c for compound interest and S for simple interest: s Principal 1000.00 1100.00 1200.001 1300.00 1400.001 1402.501 1530.001 1657.50 1785.00 Amount 1 1275.00 (base) C:\temp> (base) C:\temp>python q3.py Please input time (in years): 5 Please input interest rate: 5.5 Please input base value for principal: 1000 Please input step value for principal: 100 Please input c for compound interest and S for simple interest: C Principal 1000.00 1100.00 1200.001 1300.00 1400.00 1437.661 1568.35 1699.051 1829.741 Amount 1 1306.961 (base) C:\temp>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!