Preview

Loan Calculator

Better Essays
Open Document
Open Document
682 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Loan Calculator
Using Responsibility-driven design concepts, construct an online Java application (i.e. a Java applet to be rendered on a web-browser) that asks user for input amount of the loan, the interest rate and the number of years. The program validates the input checking for valid numeric data before continuing. If the interest rate was entered in percentage form it converts to decimal before calculation process. The program then calculates the monthly payment. The values are displayed rounded to 2 decimal places. The output for the program is the user defined input values as well as the calculated monthly payment. All the input values are accepted from the keyboard. The program uses the following formula:
[Payment = (InterestRate*LoanAmount/12)/(1.0 – Math.pow(((InterestRate/12)+1.0), (-(12*Years))))].
The final output can be displayed when all the inputs and calculations are complete.
Java applet for computing loan payments embedded in an HTML page. The user can use the applet to compute the loan payments.
[
import java.applet.Applet; import java.awt.Button; import java.awt.Graphics; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Label; import java.awt.TextField; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.NumberFormat;

/* * <applet code="Loan calculator" width=280 height=200> </applet> */

public class LoanCalculator extends Applet implements ActionListener {

TextField rateText, paymentText, periodText,amountText, totalpaymentText ;

Button doIt;

double loanamount; // original princial

double intRate; // interest rate

double numYears; // length of loan in years

double totalpayment; /* * Number of payments per year. You could allow this value to be set by the * user. */ final int payPerYear = 12;

NumberFormat nf;

public void init() { // Use a grid bag layout. GridBagLayout gbag =

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Hrm/531 Final Exam Paper

    • 807 Words
    • 4 Pages

    (a) Compute the monthly payment using the PMT function in Excel and then prepare an amortization table. Fully amortize the loan by going out to the last payment.…

    • 807 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    midterm FIN 5080

    • 2075 Words
    • 16 Pages

    Suppose you take a mortgage for $72,764 for 16 years with annual payments. If the annual interest rate is 3.4%, calculate the total interest amount paid over the life of the loan. That is, calculate the total interest paid in 16 years.…

    • 2075 Words
    • 16 Pages
    Satisfactory Essays
  • Powerful Essays

    Hrm 531 Week 2 Assignment

    • 667 Words
    • 3 Pages

    response.append( " Term of Mortgage Loan: " + ( mortgageTerm * 12 ) + " months\n" );…

    • 667 Words
    • 3 Pages
    Powerful Essays
  • Good Essays

    PRG/420 Week 3

    • 1025 Words
    • 5 Pages

    Scanner; /* * @author * Week 3 Individual Assignment * Assignment: Simple Commission Calculation Project Part 2 * Due Date: */ public class AnnualCompensationCalculator { /** * main method begins program execution */ public static void main(String args[]) { String firstName; // Get user 's first name String lastName; // Get user 's last name int salary; // User 's fixed annual salary double commissionRate; // User 's commission rate double sales; // User 's annual sales double totalCommission; // User 's total commission earned double totalCompensation; //…

    • 1025 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Mathl 104 Research Paper

    • 428 Words
    • 2 Pages

    Technology is pervading all levels of mathematics teaching and learning in our modern world, bringing ever more sharply into focus the change from traditional pencil and paper learning to a mixture of calculator, computer and pencil and paper learning environments. Currently the loan has 25 years remaining. Therefore to find out the P&I payment, you would plug in 300 for N (25x12), 5.75% for I, 0 for FV, and $112,242.47 for PV, and then press PMT which gives you the $706.12. However, we want to find out how much more money they have to pay to pay off the loan in 20 years instead of 25. Therefore change N to 240 (20x12) instead of 300. Then press PMT and we should get $788.04. Next, subtract the P&I payment they are making now (706.12) from $788.04, which tells you they need to pay $81.92 extra towards the principal each month to have the loan paid off in 20 years instead of 25.…

    • 428 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Assignment Week 1

    • 483 Words
    • 2 Pages

    at the end of the next five years, what would be the amount of each payment?…

    • 483 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    | the amount of money you will get paid at the end of the month…

    • 836 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Homework1 Parsons

    • 3490 Words
    • 14 Pages

    year after, the year after, etc.,). If the interest rate is 8% per year, what is the present value of…

    • 3490 Words
    • 14 Pages
    Good Essays
  • Powerful Essays

    Math 533 Part C

    • 1123 Words
    • 5 Pages

    The credit balance is represented by the $ and the income is represented by the $1000s.…

    • 1123 Words
    • 5 Pages
    Powerful Essays
  • Good Essays

    Chem Study

    • 1237 Words
    • 5 Pages

    Which one of the following substances will float in gasoline, which has a density of 0.66 g/mL?…

    • 1237 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Raffiee Kid Assignment

    • 551 Words
    • 3 Pages

    Question1: Raffie’s Kids, a non-profit organization that provides aid to victims of domestic violence, low-income families, and special needs children has a 30-year, 5% mortgage on the existing building. The mortgage requires monthly payments of $3,000. Raffie’s bookkeeper is preparing financial statements for the board and in doing so, lists the mortgage balance of $287,000 under current liabilities because the board hopes to pay off the mortgage in full next year. $20,000 of the mortgage principal will be paid next year according to the mortgage agreement.…

    • 551 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Study Questions 4

    • 480 Words
    • 2 Pages

    the rate, for a payment period, multiplied by the number of payment periods in a year.…

    • 480 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Compensating balance = 10% → 0.10 = loan ∙ 0.10 = $11,111,111 ∙ 0.10 = $1,111,111…

    • 761 Words
    • 6 Pages
    Satisfactory Essays
  • Powerful Essays

    Putting the values into the excel function PMT(rate, nper, pv, [fv], [type]), one gets the yearly payment amount PMT = $84.14.…

    • 1735 Words
    • 7 Pages
    Powerful Essays
  • Good Essays

    Visual Basic Practical File

    • 3284 Words
    • 14 Pages

    Aim :- WAP to take input of principal, rate & time and calculate simple interest & compound interest.…

    • 3284 Words
    • 14 Pages
    Good Essays