Question

5. Create an app that calculates the simple monthly payment for a loan. You’ll need input...

5. Create an app that calculates the simple monthly payment for a loan. You’ll need input dialog boxes to accept the loan amount, the interest rate, and the payment period (in years). Perform the calculation and output the monthly payment to a dialog box (yes, formatted as money). (app with gui in java)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MonthlyPayment.java

import java.text.DecimalFormat;

import javax.swing.JOptionPane;

public class MonthlyPayment {

public static void main(String[] args) {
  double loanAmount = Double.parseDouble(JOptionPane
    .showInputDialog("Enter the Loan Amount: "));
  double monthlyInterestRate = Double.parseDouble(JOptionPane
    .showInputDialog("Enter the loan interest: "));
  int years = Integer.parseInt(JOptionPane
    .showInputDialog("Enter the number of years: "));
  int numofMonths = years * 12;
  double monthlyPayment = (loanAmount * monthlyInterestRate)
    / (1 - (1 / Math.pow(1 + monthlyInterestRate, numofMonths)));
  DecimalFormat df = new DecimalFormat("0.00");
  JOptionPane.showMessageDialog(null, "Monthly Payment is $"
    + df.format(monthlyPayment));
}

}

Output:

Enter the Loan Amount: 10000

Enter the loan interest: 0.12

Enter the number of years: 2

Add a comment
Know the answer?
Add Answer to:
5. Create an app that calculates the simple monthly payment for a loan. You’ll need input...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • USE Javascript. Loan Calculator: Three input boxes for annual interest rate, number of years, and...

    USE Javascript. Loan Calculator: Three input boxes for annual interest rate, number of years, and loan amount for user input. Display the output monthly payment and total payment also to input boxes. Add the Reset button to clear all text boxes after the Compute Payment button.

  • Devise an app (use a GUI) to calculate and display loan repayments. The user will enter...

    Devise an app (use a GUI) to calculate and display loan repayments. The user will enter in a loan amount, term and interest rate. You calculate the periodic amount due and display it to the user. The formula you need is below. A=P{\frac {i(1+i)^{n}}{(1+i)^{n}-1}}={\frac {P\times i}{1-(1+i)^{{-n}}}}=P\left(i+{\frac {i}{(1+i)^{n}-1}}\right) where: A = periodic payment amount P = amount of principal i = periodic interest rate e.g. 7.5% per year / 12 months = 0.625% per period n = total number of payments...

  • C# Create an application that will allow a loan amount, interest rate, and number of finance...

    C# Create an application that will allow a loan amount, interest rate, and number of finance years to be entered for a given loan. Determine the monthly payment amount. Calculate how much interest will be paid over the life of the loan. Display an amortization schedule showing the new balance after each payment is made. Design an object-oriented solution. Use two classes. Loan class: characteristics such as the amount to be financed, rate of interest, period of time for the...

  • You wish to buy a car for $12,000 at a 5% annual interest rate, compounded monthly....

    You wish to buy a car for $12,000 at a 5% annual interest rate, compounded monthly. The loan will be repaid in 5 years with monthly payments. What is your monthly payment (calculated with the equations on the next page)? Compare your answer to that obtained with the built in function, PMT. Be sure to label all cells appropriately. (There is no need to create a monthly payment table, simply use the equations on the next page.) Loans: where: and,...

  • 1. What monthly payment is required to amortize a loan of $50,000 over 14 years if...

    1. What monthly payment is required to amortize a loan of $50,000 over 14 years if interest at the rate of 6%/year is charged on the unpaid balance and interest calculations are made at the end of each month? (Round your answer to the nearest cent.) $ 2. The Flemings secured a bank loan of $368,000 to help finance the purchase of a house. The bank charges interest at a rate of 3%/year on the unpaid balance, and interest computations...

  • Create a program that calculate the amount of a mortgage payment. Refer to the appropriate video...

    Create a program that calculate the amount of a mortgage payment. Refer to the appropriate video or any online source for how the mathematics of the calculation works. If given these three things: The amount of the loan in whole dollars The number of payments (e.g. 360 for 30-year) The interest rate per payment period in percent ( a positive floating-point number) The program should print out the correct value (in dollars and cents) of the per-period payment of principal...

  • 5) (10%) Calculate the monthly mortgage payment for the following two scenarios. A. $200,000 loan for...

    5) (10%) Calculate the monthly mortgage payment for the following two scenarios. A. $200,000 loan for 15 years at 3%. B. $400,000 loan for 30 years at 4%. 6) (10%) An executive wants to take out $50,000 from her retirement account at the beginning of each year that she is retired. She estimates her account will earn 3% during retirement and she will need to be able to withdraw the funds each year for 25 years. How much money will...

  • Question 8 5 pts Find the monthly payment to retire a $7500 loan over 3 years,...

    Question 8 5 pts Find the monthly payment to retire a $7500 loan over 3 years, that requires monthly payments at 4% annual interest, compounded monthly. Solve for the unknown variable to answer the previous question. You do not need to write a dollar sign. Round your final answer to the nearest cent.

  • 5)Calculate the monthly mortgage payment for the following two scenarios. A. $200,000 loan for 15 years...

    5)Calculate the monthly mortgage payment for the following two scenarios. A. $200,000 loan for 15 years at 3%. B. $400,000 loan for 30 years at 4%. 6) An executive wants to take out $50,000 from her retirement account at the beginning of each year that she is retired. She estimates her account will earn 3% during retirement and she will need to be able to withdraw the funds each year for 25 years. How much money will the executive need...

  • You decide to buy a new vehicle, but you need to take a loan in order...

    You decide to buy a new vehicle, but you need to take a loan in order to cover some of the cost. You take a loan of $14,000 that you need to pay off over the next 30 years. If the APR on the loan is 6%, how much will you need to pay every month to cover the loan? Round to the nearest whole dollar. (no commas) Monthly Payment: $ Using your calculated payment amount, how much money total...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT