Compulsory Task 1 For this task, assume that you have been approached by a small financial company and asked to create a

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Compulsory Task 1 For this task, assume that you have been approached by a small financial company and asked to create a

Post by answerhappygod »

Compulsory Task 1 For This Task Assume That You Have Been Approached By A Small Financial Company And Asked To Create A 1
Compulsory Task 1 For This Task Assume That You Have Been Approached By A Small Financial Company And Asked To Create A 1 (91.33 KiB) Viewed 60 times
Compulsory Task 1 For this task, assume that you have been approached by a small financial company and asked to create a program that allows the user to access two different financial calculators an investment calculator and a home loan repayment calculator. • Create a new Python file in this folder called finance calculators.py • At the top of the file include the line import math • Write the code that will do the following: 1. The user should be allowed to choose which calculation they want to do. The first output that the user sees when the program runs should look like this: Choose either investment of "bond from the menu below to proceedi investment bond - to calculate the amount of interest you'll earn on interest - to calculate the amount you'll have to pay on a home loan How the user capitalises their selection should not affect how the program proceeds. Le. 'Bond', 'bond', 'BOND' or 'investment, 'Investment", "INVESTMENT, etc. should all be recognised as valid entries. If the user doesn't type in a valid input, show an appropriate error message 2. If the user selects investment, do the following: Ask the user to input The amount of money that they are depositing. • The interest rate (as a percentage). Only the number of the interest rate should be entered- don't worry about having to deal with the added "%, eg. The user should enter 8 and not 8%. The number of years they plan on investing for Then ask the user to input whether they want "simple" or "compound" interest, and store this in a variable called interest. Depending on whether they typed Interest formula: "simple" or "compound", output the appropriate amount that they will get after the given period at the interest rate. Look below in "Interest formulae for the formulae to be used. The total amount when simple interest is applied is calculated as follows: A = P(1 + r. t) The Python equivalent is very similar: A =P*(1+r) The total amount when compound interest is applied is calculated as follows: A = P(1 + r) ^t The Python equivalent is slightly different. A p* math.pow((1+r), t) In the formulae above: is the interest entered above divided by 100, eg. if 8% is entered. then r is 0.08. 'p' is the amount that the user deposits. 't' is the number of years that the money is being invested for . 'A' is the total amount once the interest has been applied. Print out the answer! ■ Try enter 20 years and 8 (%) and see what the difference is depending on the type of interest rate! 3. If the user selects bond, do the following ■ Ask the user to input: • The present value of the house. E.g. 100000 • The interest rate. E.g. 7 The number of months they plan to take to repay the bond. E.g. 120 Bond repayment formula: The amount that a person will have to be repaid on a home loan each month is calculated as follows: repayment = x= (1.P)/(1- (1+i)^(-)) In the formulae above: 'p' is the present value of the house. D is the monthly interest rate, calculated by dividing the annual interest rate by 12. 'n' is the number of months over which the bond will be repaid. ■ Calculate how much money the user will have to repay each month and output the answer.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply