Question

Overview Module 3 Assignment 2 features designing a program using pseudocode and then completing the program...

Overview

Module 3 Assignment 2 features designing a program using pseudocode and then completing the program in Python using strings. M3Lab2 asks you to write a Mortgage Loan Calculator.

Each lab asks you to write pseudocode that plans the program’s logic before you write the program in Python and to turn in three things: 1) the pseudocode, 2) a screenshot of the output, and 3) the Python program.

Instructions

Pseudocode and Python Program with Strings

M3Lab2.txt has some of the code provided for a Mortgage Loan Calculator. In your lab, write the rest of the code to perform the following tasks:

  • Download the file M3Lab2_student.txt linked below these instructions to your computer.
  • Open M3Lab2_student.txt in IDLE
  • Save as M3Lab2ii.py Replace ii with your initials. Replace ii with your initials. [example for someone with the initials cc: M3Lab2cc.py]
  • Complete Steps 1-7 within the code’s comments.
  • Run your program, enter your name, and enter loan information.
  • Test your program 3 times and take a screenshot of your program’s output.
  • Save your pseudocode as M3Lab2ii.docx. Replace ii with your initials.
  • Insert a screenshot of your program output in the pseudocode’s Word file.

How to Complete Your M3 Assignment 2 Pseudocode & Python with Strings

  • Write your pseudocode and save it as M3Lab2ii.docx
  • Write your program and save it as M3Lab2ii.py
  • Take a screenshot of your program’s output and Insert it in M3Lab2ii.docx
  • Upload both M3 Lab documents (Word and Python) to M3 Assignment 2 Pseudocode & Python with Strings Assignment Submission Folder. .

M3 Lab 2:

# Calculating a mortgage loan with monthly compound interest
# By C. Calongne, 01/14/2019
# Pseudocode & Python with Strings, M3Lab2_student.py
# Write the statements requested in Steps 1-7 below
#
# See the examples in the provided code
# Use structured programming and indent your code.
# Programmer Name: *****add your name here****

print()
print("Welcome to the Mortgage Loan Calculator.")
print("****************************************")

# ****Instructions****
# Complete Steps 1-7 in the comments below. The remaining comments explain the logic.
# Customers can check a variety of loans and interest rates. When finished, type quit

# Step 1: add an input statement to enter name or type quit to exit

# Step 2: add a while loop to keep asking for a name until the user types quit

# Step 3: declare two variables for loan and interest, like months below,
# convert them to float, and ask the user to input their values to the screen.

months = float(input("How many months will it take to repay your loan? "))

print("***************************************************************")
print (name, "you requested an estimate on a loan for {0:.2f}" .format(loan))

# Step 4: add a print statement to display the interest and # of months

  
print("*******************************************************************************")
print("Here are the rates for simple interest, compound interest, and monthly interest", "\n")

# calculate the rate for one month's interest + payment by adding 1 to a month's interest
interest_rate = float((interest/12)+1)

# calculate the compound interest per payment period by raising the
# monthly payment to the negative power of total months
compound_interest = float(1-((interest/12)+1) ** -months)


# Step 5: print the interest_rate and compound_interest to the display screen

# calculate the monthly interest based on the compound interest
monthly_interest = float((interest/12)/ compound_interest)
print(monthly_interest, "\n")

# calculate the monthly loan payment with monthly compound interest
payments = float(loan * monthly_interest)


# Step 6: write a print statement that displays the monthly payments to two decimal points
# Tip: use the 0:.2f format from an earlier example, only for the payments

  

print("*******************************************")
# Step 7: add an input statement to enter name or type quit to exit


print()
print("Thank you for using the Mortgage Loan Calculator")

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Updated Code for your problem:

# Calculating a mortgage loan with monthly compound interest
# By C. Calongne, 01/14/2019
# Pseudocode & Python with Strings, M3Lab2_student.py
# Write the statements requested in Steps 1-7 below
#
# See the examples in the provided code
# Use structured programming and indent your code.
# Programmer Name: *****add your name here****

print()
print("Welcome to the Mortgage Loan Calculator.")
print("****************************************")

# ****Instructions****
# Complete Steps 1-7 in the comments below. The remaining comments explain the logic.
# Customers can check a variety of loans and interest rates. When finished, type quit

# Step 1: add an input statement to enter name or type quit to exit
name = input("Enter a name: ")
while name != "quit" :
  
if name == "Quit" or name == "quit":
break
  
# Step 2: add a while loop to keep asking for a name until the user types quit
  
# Step 3: declare two variables for loan and interest, like months below,
# convert them to float, and ask the user to input their values to the screen
  
  
loan = float(input("Enter the total amount of loan: "))
interest = float(input("Enter the interest: "))
months = float(input("How many months will it take to repay your loan? "))
print("***************************************************************")
print (name, "you requested an estimate on a loan for {0:.2f}" .format(loan))
  
# Step 4: add a print statement to display the interest and # of months
print("interest = " + str(interest))
print("number of months = " + str(months))
  
print("*******************************************************************************")
print("Here are the rates for simple interest, compound interest, and monthly interest", "\n")
  
# calculate the rate for one month's interest + payment by adding 1 to a month's interest
interest_rate = float((interest/12)+1)
  
# calculate the compound interest per payment period by raising the
# monthly payment to the negative power of total months
compound_interest = float(1-((interest/12)+1) ** -months)
  
  
# Step 5: print the interest_rate and compound_interest to the display screen
print("interest_rate = " + str(interest_rate))
print("compound_interest is= " + str(compound_interest))
# calculate the monthly interest based on the compound interest
monthly_interest = float((interest/12)/ compound_interest)
print(monthly_interest, "\n")
  
# calculate the monthly loan payment with monthly compound interest
payments = float(loan * monthly_interest)
  
  
# Step 6: write a print statement that displays the monthly payments to two decimal points
print (name, "your monthly loan payment is {0:.2f}" .format(payments))
# Tip: use the 0:.2f format from an earlier example, only for the payments
  
  
  
print("*******************************************")
# Step 7: add an input statement to enter name or type quit to exit
name = input("Enter a name: ")


print()
print("Thank you for using the Mortgage Loan Calculator")

Here a sample output of above program:

Welcome to the Mortgage Loan Calculator.
****************************************
Enter a name: amb
Enter the total amount of loan: 8000
Enter the interest: 10
10
How many months will it take to repay your loan? 6
***************************************************************
amb you requested an estimate on a loan for 8000.00
interest = 10.0
number of months = 6.0
*******************************************************************************
Here are the rates for simple interest, compound interest, and monthly interest

interest_rate = 1.8333333333333335
compound_interest is= 0.973663904319411
0.8558737051219246

amb your monthly loan payment is 6846.99
*******************************************
Enter a name: quit
quit

Thank you for using the Mortgage Loan Calculator

Note:

1) I have added my code just in the same place it has asked in comments. So you can just check the code below every step.

2) If you have any doubts ask me in the comments section and please upvote the answer.

Add a comment
Know the answer?
Add Answer to:
Overview Module 3 Assignment 2 features designing a program using pseudocode and then completing the program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Overview Module 3 Assignment 1 features the design of a pseudocode and a Python program that...

    Overview Module 3 Assignment 1 features the design of a pseudocode and a Python program that uses iteration to guess a number from 1 to 10. Each lab asks you to write pseudocode that plans the program’s logic before you write the program in Python and to turn in three things: 1) the pseudocode, 2) a screenshot of the output, and 3) the Python program. Instructions Write pseudocode for a Python program that uses iteration to guess a number from...

  • Hello! I'm looking for help with this assignment. Complete a program in pseudocode and Python that...

    Hello! I'm looking for help with this assignment. Complete a program in pseudocode and Python that performs the following tasks. Open the file called M4Lab1ii.py linked below these instructions in your M4 Content module in IDLE. Save as M4Lab1ii.py. Replace ii with your initials. [example for someone with the initials cc: M4Lab1cc.py] Complete Steps 1-7 as requested within the code’s comments. Run your program and test all four calculations, then exit the program. Save your program as M4Lab1ii.py using your...

  • The program is in python :) Write a code program to calculate the mortgage payment. The...

    The program is in python :) Write a code program to calculate the mortgage payment. The equation for calculating the mortgage payment is: M = P (1+r)n (1+r)n-1 Where: M is your monthly payment P is your principal r is your monthly interest rate, calculated by dividing your annual interest rate by 12. n is your number of payments (the number of months you will be paying the loan) Example: You have a $100,000 mortgage loan with 6 percent annual...

  • Write a python program and pseudocode The Program Using Windows Notepad (or similar program), create a...

    Write a python program and pseudocode The Program Using Windows Notepad (or similar program), create a file called Numbers.txt in your the same folder as your Python program. This file should contain a list on floating point numbers, one on each line. The number should be greater than zero but less than one million. Your program should read the following and display: The number of numbers in the file (i.e. count them) (counter) The maximum number in the file (maximum)...

  • I have a program I am trying to build as homework in PYTHON. The program consists...

    I have a program I am trying to build as homework in PYTHON. The program consists of a calculator for shopping where input asks the customer for the price of a product and then print; 1. The TOTAL of all products if the customer wishes to add it on 2. PRINTS "Do you wish to add this to your total" then 3. The TOTAL. then the program repeats as the customer continues to shop. The program must also have a...

  • python 3 8.12 LAB: Python cross reference In addition to editors and compilers, a software developer...

    python 3 8.12 LAB: Python cross reference In addition to editors and compilers, a software developer may use tools to analyze the software they are writing to examine the names being used for variables and functions, and list the line numbers where the variables and functions names appear. For example, consider the following program savings.py used to compute the month to month interest gained from a certificate of deposit: 1: Input the CD APR, no years and initial deposit 2:...

  • MATLAB!!! CAN SOMEONE SOLVE THIS PROBLEM ON MATLAB?? THANK YOU PART B: HOUSING LOAN CALCULATOR In this part of the assignment, you are expected to develop a program that calculates housing loan pay-...

    MATLAB!!! CAN SOMEONE SOLVE THIS PROBLEM ON MATLAB?? THANK YOU PART B: HOUSING LOAN CALCULATOR In this part of the assignment, you are expected to develop a program that calculates housing loan pay- ments based on compound interest formulas The program should prompt a user to input the amount borrowed (principal), p, the number of monthly payments, n, and an annual interest rate in R percent. The program should convert the annual interest rate R into a monthly interest rate...

  • c++ and please add tables and everything and make sure program is complete. Write a menu...

    c++ and please add tables and everything and make sure program is complete. Write a menu driven program, which would compute compound interest and a monthly payment for a loan. The user will be given a choice to display the info on the screen or to a filo Menu will be the following Enter (1) to calculate your loan monthly payment Enter (2) to calculate your loan monthly payment & write to a file Tips: Compound Interest Formula A =...

  • Requirement Write pseudocode and translate it to ONE C-program for each the following problems. In your...

    Requirement Write pseudocode and translate it to ONE C-program for each the following problems. In your pseudocode and C-program, use only what you have learned in this class so far. (Menu) Design a menu for question 2 and 3. So far, you use one program to solve all lab questions. But some of you may feel awkward when you want to demo/test only one lab question. To overcome that, your program should show a menu so that the users of...

  • Using c++ 1 of 2 Assignment 5 Lab Section 3 write a program create a vector...

    Using c++ 1 of 2 Assignment 5 Lab Section 3 write a program create a vector with random numbers. Use merge sort to reorder the vector Prompt user to enter a number to search in the vector. If there are more than one number in the vector equal to the search value, display the indices remove the repeated numbers. If found just one matching number, display the index. If no matching number, prompt user for 2 options: add to the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT