Your task in this assignment is to write a program that calculates annual compound interest. In...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Your task in this assignment is to write a program that calculates annual compound interest. In terms of output, this programming assignment is very similar to the last assignment i.e. prompt the user for their name and some numerical values and carry out a calculation. However, this assignment requires the use of multiple custom functions that must be designed using the constraints described later in this document. Below is a sample run with the user input in red: Please enter your name: Joe King Please enter the principal: 10000 Please enter the annual percentage rate: 5 Please enter the number of years: 20 Hello Joe King, the final amount after 20 years at 5.0% is $26532.97705144422 Here's output of another sample run (again, user input is shown in bold red): Please enter your name: Amanda Please enter the principal: 100 Please enter the annual percentage rate: 5.5 Please enter the number of years: 20 Hello Amanda, the final amount after 20 years at 5.5% is $291.77574906040877 To help clarify, here are some specifics and/or constraints: (1) Your program will require at least three user-defined functions. Feel free to add any extra functions you think are necessary. A function that prompts the user for their name and returns it to the calling statement. This function should not take any arguments. O O O A function that receives a single argument (a string that describes a piece of data), uses that argument when prompting the user for some data, returns the data to the calling statement. A function that receives three arguments that represent the principal amount, the annual compound interest rate, and the number of years. This function uses those three piece of data to calculate the total amount and returns that amount to the calling statement. (2) The main part of your program should make use of the functions (outlined above) in such a way as to satisfy the problem statement i.e. get the user's name and information, and print the total amount after compound interest is applied. (3) Your output should be exactly like the sample runs shown above (of course, actual input values and calculations will vary depending on the provided inputs); (4) You must include a meaningful header, use good coding style, use meaningful variable names, and comment your source code where appropriate; (5) You must use the provided source code template (it contains helpful comments that can help you structure your code); and (6) You must submit your source code as a single .py file. The formula for compound interest is A=P(1+) where A is the final Amount, P is the initial amount, r is the percentage interest rate, and t is the number of years. 100 Your task in this assignment is to write a program that calculates annual compound interest. In terms of output, this programming assignment is very similar to the last assignment i.e. prompt the user for their name and some numerical values and carry out a calculation. However, this assignment requires the use of multiple custom functions that must be designed using the constraints described later in this document. Below is a sample run with the user input in red: Please enter your name: Joe King Please enter the principal: 10000 Please enter the annual percentage rate: 5 Please enter the number of years: 20 Hello Joe King, the final amount after 20 years at 5.0% is $26532.97705144422 Here's output of another sample run (again, user input is shown in bold red): Please enter your name: Amanda Please enter the principal: 100 Please enter the annual percentage rate: 5.5 Please enter the number of years: 20 Hello Amanda, the final amount after 20 years at 5.5% is $291.77574906040877 To help clarify, here are some specifics and/or constraints: (1) Your program will require at least three user-defined functions. Feel free to add any extra functions you think are necessary. A function that prompts the user for their name and returns it to the calling statement. This function should not take any arguments. O O O A function that receives a single argument (a string that describes a piece of data), uses that argument when prompting the user for some data, returns the data to the calling statement. A function that receives three arguments that represent the principal amount, the annual compound interest rate, and the number of years. This function uses those three piece of data to calculate the total amount and returns that amount to the calling statement. (2) The main part of your program should make use of the functions (outlined above) in such a way as to satisfy the problem statement i.e. get the user's name and information, and print the total amount after compound interest is applied. (3) Your output should be exactly like the sample runs shown above (of course, actual input values and calculations will vary depending on the provided inputs); (4) You must include a meaningful header, use good coding style, use meaningful variable names, and comment your source code where appropriate; (5) You must use the provided source code template (it contains helpful comments that can help you structure your code); and (6) You must submit your source code as a single .py file. The formula for compound interest is A=P(1+) where A is the final Amount, P is the initial amount, r is the percentage interest rate, and t is the number of years. 100
Expert Answer:
Answer rating: 100% (QA)
Based on the assignment details provided in the image you are required to write a program in Python that computes the final amount of an investment af... View the full answer
Related Book For
An Introduction to the Mathematics of Financial Derivatives
ISBN: 978-0123846822
3rd edition
Authors: Ali Hirsa, Salih N. Neftci
Posted Date:
Students also viewed these programming questions
-
: (i) What data structures are maintained by the page manager. (ii) What happens when a machine performs a read operation to a page. (iii) What happens when a machine performs a write operation to a...
-
llustrate different ways of connecting these components together to span a range of performance requirements. [10 marks] For each of the performance categories that you identify state today's typical...
-
Identify the accounting periods relating to the following periods of account: (a) year to 30 November 2020 (b) 1 October 2019 to 31 July 2020 (c) 1 January 2021 to 31 January 2021 (d) 33 months to 31...
-
(i) What information can be presented as evidence during arbitration proceedings? (ii) What are the usual hearing procedures?
-
A stone thrown horizontally from the top of a 24-m tower hits the ground at a point 18 m from the base of the tower. (a) Find the speed at which the stone was thrown. (b) Find the speed of the stone...
-
Figure P28.26 shows part of the rotation of an electric motor, during which the magnetic dipole moment of the loop points to the left or has some component to the left. If the entire rotation were...
-
Depreciation ComputationsSYD, DDBPartial Periods Cosby Company purchased a new plant asset on April 1, 2010, at a cost of $774,000. It was estimated to have a service life of 20 years and a salvage...
-
6. The major components in "Gun Metal" are: (a) Cu, Ni and Fe (b) Al, Cu, Mg and Mn (c) Cu, Sn and Zn 7. 8. Which of the following ore is concentrated using group 1 cyanide salt (a) Calamine (b)...
-
Oceanic Airlines is considering installing new entertainment consoles into their air liners. Their initial proposal has a cost of $280,000 and will bring increased operating cash flows of $ 190,000...
-
Is it possible for the acceleration and velocity vectors of an object to be always perpendicular to each other? If no, explain why not. If yes, describe the motion.
-
When a car accelerates gradually (no squealing tires), is the friction between tires and road kinetic or static?
-
A common parlor trick is to yank a tablecloth hard so that any dishes and glasses on the cloth stay put instead of falling onto the floor. (a) Explain how this happens. (b) Why, if you pull on the...
-
Approximate the Sun as a uniform sphere of radius \(6.96 \times 10^{8} \mathrm{~m}\), rotating about its central axis with a period of 25. 4 days. If, at the end of its life, the Sun collapses inward...
-
A child rides her bike five blocks east and then three blocks north. It takes her \(15 \mathrm{~min}\), and each block is \(160 \mathrm{~m}\) long. What are \((a)\) the magnitude of her displacement,...
-
A water balloon of mass 180 grams is launched with an initial (vertical) velocity of 45 meters per second, and is leaking at a rate of 50 grams per second. Assume air resistance is proportional to...
-
A company produces earbuds. The revenue from the sale of x units of these earbuds is R = 8x. The cost to produce x units of earbuds is C = 3x + 1500. In what interval will the company at least break...
-
Suppose you are given the following information on the spot rate rt: The rt follows: drt = rtdt + rtdWt The annual drift is = 0.01 The annual volatility is = 12% The current spot rate is...
-
In Example 7 find the breakeven spread that is the spread that makes present value of the fixed leg the same of present value of the contingent leg.
-
Consider a first-to-default basket (FTD) that pays (1 R) upon the default of the first credit in a basket of 3 credits. Protection on the FTD lasts 5 years and payments are made quarterly. The...
-
An old-fashioned tire swing exerts a force on the branch and a torque about the point where the branch meets the trunk. If you hang the swing closer to the trunk, this will --the force and-- the...
-
Which of these objects is in static equilibrium? A. B. C. D.
-
A beam with a pivot on its le ft end is suspended from a rope. Tn which direction is the force of the pivot on the beam? A. B. C. D. E.
Study smarter with the SolutionInn App