• 100% Satisfaction Guarantee
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13121
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
29751445
LogicPro is online now

# Need a fix to my code in Visual Basic 2010!

Below is what the interface is displaying.

This is what is supposed to do: (From Book)

you create an application that displays a monthly payment on a loan of \$3000 for 1 year at 7% interest. The application also should display the amount applied to the loans principal each month, and the amount that represents interest. The application will use the Financial.Pmt method, which you learned about in the chapter, to

calculate the monthly payment. It also will use the Financial.PPmt method to calculate the portion of the payment applied to the principal each month. The methods syntax is Financial.PPmt(Rate, Per, NPer, PV), where Rate is the interest rate, NPer is the number

of payment periods, and PV is the present value of the loan. The Per argument is the payment period in which you are interested and must be from 1 through NPer.

a. List the output and input items, as well as any processing items, and then create an appropriate algorithm using pseudocode.

b. Create a Visual Basic Windows application. Use the following names for the solution and project, respectively: Principal and Interest Solution, and Principal and Interest

Project. Save the application in the ClearlyVB2010\Chap14 folder. Change the name of the form file on your disk to frmMain.vb. If necessary, change the forms name to

frmMain.

c. Create the interface shown in Figure 14-16. Set the text boxs Multiline and ReadOnly

properties to True.

d. Code the application using a ForNext statement to keep track of the

Financial.PPmt methods Per argument. The Per values will be from 1 through 12.

e. Save the solution and then start and test the application. (Hint: The monthly payment

should be \$259.58. In the first month, 242.08 is applied to the principal, and 17.50 is

interest.) Close the Code Editor window and then close the solution.

This is my code:

Public Class Form1

Private Sub btnDisplayPrincipal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplayPrincipal.Click

Dim MonthlyPayments As Double

Dim bloanTotal As Double = 3000

Dim rate As Double = 0.007

Dim interest As Double

Dim toPrincipal As Double

Dim toInterest As Double

Dim counter As Integer

For counter = 1 To 12

'Calculate the monthly payments

MonthlyPayments =

Math.Abs(Financial.Pmt(0.07 / 12, 12, 3000))

TextBox1.Text = MonthlyPayments.ToString("C2")

counter = counter + 1    'add one to the counter

interest = bloanTotal + rate   'calculate interest rate from payment that will only count as interest

toInterest = MonthlyPayments - interest ' amount of monthly payment going towards interest

toPrincipal = MonthlyPayments - toInterest ' amount of monthly payment going towards principal

bloanTotal = bloanTotal - toPrincipal ' new balance after deducting principal from beginning balance

lblMonthlyPayment.Text &= toPrincipal.ToString & "   " & toInterest.ToString & ControlChars.NewLine

Next

End Sub

Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click

Me.Close()

End Sub

End Class

Hi,

Customer: replied 4 years ago.

I couldn't use wikisend, didn't work with me. I used filemail instead. Here's the link:

https://www.filemail.com/dl.aspx?id=YROIKKLSGVOHNTT

This is also for monday may 13. Thanks!

I will review and let you know ASAP.
What is the deadline for this?
Customer: replied 4 years ago.
Tomorrow
ok, I will provide you answer ASAP.