Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Algorithmic Trading Navigating The Digital Frontier

Authors: Alex Thompson

1st Edition

B0CHXR6CXX, 979-8223284987

More Books

Students also viewed these Databases questions

Question

12.2 Explain how to organize supporting material.

Answered: 1 week ago