HW3 VB .Net Advanced Loan Calculator Due in class Friday 6 December - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

HW3 VB .Net Advanced Loan Calculator Due in class Friday 6 December

Description:

HW3. VB .Net Advanced Loan Calculator. Due in class Friday 6 December. HW3. IS3001. George Zolla ... equation may be used to calculate the length of the loan: ... – PowerPoint PPT presentation

Number of Views:327
Avg rating:3.0/5.0
Slides: 14
Provided by: carlo316
Category:

less

Transcript and Presenter's Notes

Title: HW3 VB .Net Advanced Loan Calculator Due in class Friday 6 December


1
HW3VB .Net Advanced Loan CalculatorDue in
class Friday 6 December
HW3
IS3001 George Zolla
Naval Postgraduate School
Monterey, CA
2
HW3 Requirements
  • 1. Write a VB .Net project that allows the user
    to calculate the monthly payment, the term
    (length) or the amount of a loan. Depending on
    the calculation to be performed, the user will
    input values for the amount of the loan, the
    annual interest rate, the length of the loan
    and/or the monthly payment. The program will
    perform the desired calculation and display the
    results to the user.

3
HW3 Requirements
  • 2. Design the program to check the users inputs
    for errors. The minimum validation method to use
    is the Try/Catch Block (page 122). Extra points
    can be earned if the program checks for (1)
    numeric input using the IsNumeric function (page
    165) (2) unwanted or , characters, (3)
    required values and (4) protects the program from
    crashing because of unwanted zeros.

4
HW3 Requirements
  • 3. The flow should be
  • Determine which calculation to make.
  • Validate the user input Hold till program works
  • Make the calculations
  • Display the results.
  • 4. Format the results with the FormatCurrency, or
    the FormatNumber function found on pages 114 and
    115.

5
HW3 Requirements
  • 5. Use the conventions recommended in the text
    and the guidance and requirements contained in
    the Project Evaluation Sheet including project
    submission instructions. Plus
  • Use meaningful names for controls, variables and
    the form
  • Pay particular attention to the data types used.
  • Images may be used to enhance the visual
    effectiveness
  • Use Default and Cancel buttons
  • The project folder must fit on one floppy, CD or
    zip disk

6
HW3 Requirements
  • The following variable names may be used in your
    solution (name with data types)
  • dblMonthlyRate CDbl(txtRate.Text) /1200
  • dblMonths CDbl(txtYears.Text) 12
  • dblAmount CDbl(txtAmount.Text)
  • dblMonthlyPayment
  • CDbl(txtMonthlyPayment.Text)
  • Note I divided the dblMonthlyRate by "1200" vice
    "12" to allow the users to input the interest
    rate as 7.0 vice .07.

7
HW3 Requirements
  • 7. The following equation may be used to
    calculate the monthly payment (pg 558)
  • dblMonthlyPayment - Pmt(dblMonthlyRate,
    dblMonths, dblAmount)
  • Notice the minus sign before the Pmt function to
    create a positive answer.

8
HW3 Requirements
  • 8. The following equation may be used to
    calculate the length of the loan
  • dblMonths NPer(dblMonthlyRate, -
    dblMonthlyPayment, dblAmount)
  • dblYears dblMonths/12
  • Convert back to years

9
HW3 Requirements
  • 9. The following equation may be used to
    calculate the Loan Amount
  • dblFactor (1 dblMonthlyRate) (dblMonths)
  • dblAmount dblMonthlyPayment / (dblMonthlyRate
    dblFactor / (dblFactor - 1))

10
HW3 Requirements
  • 10. (Optional) The following equation may be used
    to calculate the Interest Rate (Pg 558)
  • dblAnnualRate Rate(dblMonths,
  • -dblMonthlyPayment, dblAmount) 1200
  • Note Multiply the Rate by 1200 to return to
    yearly numbers (7.0)

11
InStr String Function
  • InStr(SourceString, SearchString)
  • If CBool(InStr(txtInput.Text, )) Then
  • IF CBool(InStr(txtInput.Text, ,)) Then
  • IF InStr(txtInput.Text, ) 1 Then OK
  • IF Not InStr(txtInput.Text. )
  • Doesnt Work

12
IsNumeric String Function
  • IsNumeric(SourceString)
  • IF IsNumeric(txtInput.Text) Then
  • IF Not IsNumeric(txtInput.Text) Then
  • Pages 165

13
Replace String Function
  • Replace(strOldValue, strNewValue)
  • txtAmount.Text
  • txtAmount.Text.Replace(", "")
  • Replaces the dollar sign with a null string.
    Basically deletes the dollar sign.
  • Page 563
Write a Comment
User Comments (0)
About PowerShow.com