Important alert: (current site time 5/20/2013 1:45:53 AM EDT) Brand new: recommended reading for every programming language on the site | revamped discussion board | 7 Source Code CDs

simple mortgage calculator

Email
 Submitted on: 9/11/2012 1:30:06 PM By: Joshua Conklin Level: Beginner User Rating: Unrated Compatibility: C# Views: 1147

(About the author)

basic mortgage calculator.. i was assigned this in class. the instructor helped me with the annuity equation. i cant take full credit. but thought i would share.

code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 Terms of Agreement:    By using this code, you agree to the following terms...    You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.    You may link to this code from another website, but ONLY if it is not wrapped in a frame.  You will abide by any additional copyright restrictions which the author may have placed in the code or code's description. ``` //************************************** // Name: simple mortgage calculator // Description:basic mortgage calculator.. i was assigned this in class. the instructor helped me with the annuity equation. i cant take full credit. but thought i would share. // By: Joshua Conklin // //This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=8845&lngWId=10//for details.//************************************** using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace mortgage { class Program { static void Main(string[] args) { double annuity; double months; Console.WriteLine("Enter monthly interest rate:"); double rate = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter number of years:"); double years = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter amount for monthly payment:"); double monthlypayment = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter loan amount:"); double loanamount = Convert.ToDouble(Console.ReadLine()); months = years * 12; rate/=1200; annuity=(1-Math.Pow((1+rate),-months)) / rate; if (monthlypayment == 0) { monthlypayment = loanamount / annuity; } if (loanamount == 0) { loanamount = monthlypayment * annuity; } Console.WriteLine("Interest: " + rate); Console.WriteLine("Years: " + years); Console.WriteLine("Payments: " + monthlypayment); Console.WriteLine("Loan size: " + loanamount); Console.ReadLine(); } } } ```

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)

To post feedback, first please login.