Purchase Solution

Implement a simple mortgage calculator in Python.

Not what you're looking for?

Ask Custom Question

Implement a simple mortgage calculator in Python that calculates monthly mortgage payment amount such that each monthly payment repays same amount of principle, and monthly interest.

When run, the program should display five menu options to perform mortgage related calculations and sixth option to exit the program, as indicated below.

1. Monthly payment
2. Total interest
3. Monthly interest payment
4. Principle left after monthly payment
5. Daily payment rate for 30 days
6. Exit the program

All of the menu items perform different calculations and display result successfully.
Program should continue asking user for a choice and performing relevant calculations, till user chooses to exit the program.

Purchase this Solution

Solution Summary

Program validates user choice and does not proceed further till user makes a valid choice. Program is thoroughly modular, uses self documenting variable and function names, and is well commented for easier understanding. It makes use of if-elif-else and while-else statements.
Python 2.7.8 was used during development and testing of the program.

Solution Preview

You can execute the attached program as "python 624099.py", or you can follow given steps to execute it like "./624099.py".
- chmod +x 624099.py
- Ensure that first "#!" line specifies correct path to Python interpreter on your system.
----------------------------------------------------
#! /usr/bin/python

#
# This program implements a simple Mortgage Calculator for the user.
# It is considered that each monthly payment repays same amount of
# principle, and interest, irrespective of whether it is first month
# payment or last month payment.
#

# This function presents user with 6 choices, and returns a valid
# choice made by user.

def menu ():
menuString = """
Simple Mortgage Calculator
--------------------------
1. Monthly payment
2. Total interest
3. Monthly interest payment
4. Principle left after monthly payment
5. Daily payment rate for 30 days
6. Exit the program
"""

print(menuString)
choice = int(input("Please choose an option: "))

# Accept only a valid choice
while (choice < ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.