# Thread: Creating a Mortgage calculator app

1. ## Creating a Mortgage calculator app

A bank offers mortgages that can be repaid in 5, 10, 15, 20, 25 or 30 years. Write can an app that allows the user to enter the price of a house (The amount of the mortgage) and the annual interest rate. When the user clicks the Calculate Button, the app displays a table of the mortgage length in years together with the monthly payment.

Download the template (MortgageCalculator.zip) from Blackboard class account in Exercises folder, and then unzip it to your working directory.
2. Opening the app’s template file:
Double click MortgageCalculator.sln in the MortgageCalculator directory to open the app.
Add a ListBox as shown above. Name it resultsListBox.
4. Adding a Calculate Button event handler:
Double click the Calculate Button to generate the empty event handler calculateButton_Click. Add the code specified in the remaining steps to your event handler.
5. Converting the annual interest rate to the monthly interest rate:
To convert the annual interest rate from a percent value into its Double equivalent, divide the annual rate by 100. Then divide the Double annual rate by 12 to obtain the monthly rate.
6. Clearning the ListBox:
Use method Clear on the Items property to clear the ListBox of any previous data.
Use method Add to display a header in the ListBox. The header should be the column headers “Mortagage Length (Years)” and “Monthly Payment”, separated by a tab character.
8. Using a repetition statement:
Add a Do While … Loop repetition statement to calculate six monthly payment options for the user’s mortgage. Each option has a different number of years that the mortgage can last. For this exercise, use the following numbers of years: 5, 10, 15, 20, 25 and 30.
9. Converting the length of the mortgage from years to months:
Convert the number of years to months.
10. Calculating the monthly payments for six different mortgages:
Use the Pmt function to compute the monthly payments. Pass to the function the monthly interest rate, the number of months in the mortgage and the mortgage amount. Remember that the mortgage amount must be negative, because it represents an amount of money being paid out by the lender.
11. Displaying the results:
Use method Add on the Items property to display the length of the mortgage in years and the monthly payment in the ListBox. Use three tab characters to ensure that the monthly payment appears in the second column.
12. Compile the app:
Select Build > Rebuild to compile the MortgageCalculator project
13. Running the app:
Select Debug > Start Debugging to run MortgageCalculator app. Enter mortgage amount and annual interest rate, and then click the Calculate Button. Verify that the monthly payments displayed contain the correct values.

2. ## Re: Creating a Mortgage calculator app

Originally Posted by weibec1
That still doesn't justify cheating. Show us what you've done and tell us where you're stuck and we'll gladly help you solve your issue. If you haven't done anything then you don't deserve any marks for the assignment, especially when there are others who are doing something.

3. ## Re: Creating a Mortgage calculator app

Originally Posted by weibec1

You have it spelled out, step by step, right in front of you. What more do you need?

4. ## Re: Creating a Mortgage calculator app

Lol. This tells you exactly what you need to do. This is also some basic programming. Like, real basic, especially since it tells you EXACTLY what to do. Did you not pay attention in class? I don't think you should be taking this level of programming. You may want to drop down to a more basic level if you don't understand how this works.

5. ## Re: Creating a Mortgage calculator app

Here's some code to get you started:

Code:
```        For x As Integer = 1 To 13
Do Step x
Next```

6. ## Re: Creating a Mortgage calculator app

Believe me I have inquired on if I can take another class. The professor is absolutely NO help. Other classmates are just as confused. It is an online class and he doesn't reply to anything we send to him. Its sad when I cant even figure out the first line. I don't understand any of it no matter how many times I read the chapters. I totally wish there was an Intro to this class but I guess not. I already took a zero on an assignment because I missed a step and couldn't get the program to run. So If you don't want to help then move along. No need to criticize me. This class is the only thing keeping me from graduating and I'm never going to use programming again. I don't even know why I have to take it seeing how im doing the most basic degree in computer technology.

7. ## Re: Creating a Mortgage calculator app

Also is step 5 that im stuck on...I really suck at formulas

8. ## Re: Creating a Mortgage calculator app

Originally Posted by weibec1
Believe me I have inquired on if I can take another class. The professor is absolutely NO help. Other classmates are just as confused. It is an online class and he doesn't reply to anything we send to him. Its sad when I cant even figure out the first line. I don't understand any of it no matter how many times I read the chapters. I totally wish there was an Intro to this class but I guess not. I already took a zero on an assignment because I missed a step and couldn't get the program to run. So If you don't want to help then move along. No need to criticize me. This class is the only thing keeping me from graduating and I'm never going to use programming again. I don't even know why I have to take it seeing how im doing the most basic degree in computer technology.
No on here is going to do your homework for you. Ask questions and you will get answers.

9. ## Re: Creating a Mortgage calculator app

Originally Posted by weibec1
Also is step 5 that im stuck on...I really suck at formulas
Step 5 is simple mathematics... Your course should have had some math and computer programming prerequisites because you shouldn't belong in it.

What are you stuck on at step 5? You just have to divide a number by a few things and you get the answer. It tells you there what you need to divide it by. Give us an example of the formula you have for step 5 and I will look at it

10. ## Re: Creating a Mortgage calculator app

Hope that helps you to create the formula. Remember to use type double when you are defining the variable.

11. ## Re: Creating a Mortgage calculator app

Originally Posted by weibec1
Also is step 5 that im stuck on...I really suck at formulas
When I first read that, I was taken off guard, thinking that the prof. must really be crumby to make the computer class come up with their own formulas. So I went back and read the assignment:
Originally Posted by Assignment
5. Converting the annual interest rate to the monthly interest rate:
To convert the annual interest rate from a percent value into its Double equivalent, divide the annual rate by 100. Then divide the Double annual rate by 12 to obtain the monthly rate.
Nevermind, the assignment does tell you exactly how to create the formula....
Code:
`MonthlyInterestRate = (AnnualInterestRate / 100) / 12`

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

Featured