
Write a
1. Calculate Interest Rate
2. Calculate Mortgage
99 Quit
If the user selects 1, then calculate interest rate. Create a python function that will continuously ask the user for inputs to calculate interest earned until the user enters a number 0 (zero) in principle. Once the user enters any number less than or equal to 0 in principle, the program will exit. The program should use while loop to ask the user for inputs.
Assume the following variables:
- p is the initial principle balance
- r is the annual interest rate
- n is the amount of times the interest compounds in a year
- t is the number of years
To calculate balance the formula used should be:
- total = p*(1+float(r/100)/n)**(n*t)
- interest = total - p
Use import to include this function in the main program.
If user choice selection 2, then calculate mortgage. For this, you need to write another separate python program function that will calculate mortgage payment that will be imported in. You can modify the interest program with the following formulate:
The formula to calculate mortgage payment should be:
monthlyRate = (interestRate / 100) / 12
numPayments = loanTerm * 12
monthlyPayment = loanAmount * monthlyRate \
* pow((1 + monthlyRate), numPayments) \
/ (pow((1 + monthlyRate),numPayments) - 1)
totalPayment = monthlyPayment * (loanTerm * 12)
interestPaid = totalPayment - loanAmount
If the user enters a number in the main menu that is not a valid menu selection, the program should ask the user to select one of the command numbers above.
After finishing calculating something, the program should be able to calculate another set of numbers for the same task unless the user enters 0, where the program will then exit to the main menu.
The program should look as it does in the images.



Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images

- Write a program given the following requirements Loop through numbers 1 through 50. If a number is divisible by 3, return "Wooly" If a number is divisible by 5, return "Bully" If a number is divisible by 3 and 5, return "Wooly Bully" If a number is NOT divisible by 3 or 5, return the number Information that should help Use the modulo (%) function in python to determine if a number is divisible by another number. 6%3=0 because when 6 is divided by 3, there is 0 left over. 5%3=2 because when 5 is divided by 3, there is 2 left over I recommend a for loop, but a while loop would work as well. Deliverables Word document of pseudocode or flowchart representing the program The python (.py) file. Name should be "Wooly Bully" The beginning of your output (1-15) should look something like: 1 2 Wooly 4 Bully Wooly 7 8 Wooly Bully 11 Wooly 13 14 Wooly Bullyarrow_forwardusing C language, create a function to determine if a number is prime. The function will return 1 if it is prime, or 0 otherwise. Use one int argument, and use a simple loop to determine if a number is prime.arrow_forwardA County collects property taxes on the assessment value of the property, which is 60 percent of the property's actual value. For example if an acre of land is valued $10,000.00 its assessment value is $6000. The property tax is 72 cents for each $100.00 of the assessment value. The tax for the assessed at $6000 will be $43.20. Write a PYTHON program using FUNCTIONS that asks for the actual value of a piece of property and displays the assessment value and property taxarrow_forward
- The prompt asks: Write a function that calculates the amount of money a person would earn over a period of years if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should ask the user for the number of years and call the function which will return the total money earned in dollars and cents, not pennies. Assume there are 365 days in a year. function totalEarned(years) { } var yearsWorked = parseInt(prompt('How many years will you work for pennies a day? ')); alert('Over a total of ' + yearsWorked + ', you will have earned $' + totalEarned(yearsWorked));arrow_forwardProblem - 1: Write a program that asks the user to enter a minute value. The main() function should display the minutes in the format shown in the following sample run: Enter the number of minutes: 568 Time: 9:28arrow_forwardWrite a section of Python code (not an entire function) that: Asks the user to input a number between 1 and 10.You do not need to validate the user's input. Displays the message, "This is a low number." if the number is from 1 to 5. Displays the message, "This is a high number." if the number is from 6 to 10. Write the Python code as efficiently as possible.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





