Answered step by step
Verified Expert Solution
Question
1 Approved Answer
they have to manually change the function that computes annual interest for fixed deposit customers. Annual interest is calculated using the formula: Principal Rate X
they have to manually change the function that computes annual interest for fixed deposit customers. Annual interest is calculated using the formula: Principal Rate X Time where principal is the amount being invested, rate is the investment rate in percentage and time is the period of investment in years. For example, if a customer invests $2,000 at 2% for 5 years, interest is computed as 2000 x (2/100) x 5-200 $14.14 The function that XYZ bank currently uses to compute interest is shown below def interestO return ((2000 (2/100) 5)).5 Your job is to improve the above function using generalization and the math module so that the function can be easily re-used whenever the bank has a new customer, without having to change the lines of code each time. Write a new Python function new interest that improves the interest function. Generalizing the function should come first: getting input from the console and calling the generalized function should come after the function is generalized. The input text from the console should happen outside of the function. Ask the user to input values for each of the function arguments from the console. You may assume that the and output its return value to the console Tip: You might vant to define the function new.interest using parameters. Tip: You should use the sqrtO function of the math module
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started