Question

this is what it should look like only it is not set to any number you input the numbers yourself and it calculates it. The code should be in java

JavaScript Loan Calculator Microsoft Internet Explorer Ele Edit Yew Favortes ools Help Links Enter Loan Information: 1) Amoun

this is the end result only the information needed not having it in a window

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

/* Java program to calculate the monthly payment, total payment and total interest payment

* for given loan amount, annual rate of interest and re-payment years

*/

import java.util.Scanner;

public class LoanCalculator {

       public static void main(String[] args) {

             double loanAmount, annualInterestRate, monthlyPayment, totalPayment, totalInterest;

             int numberOfYears;

            

             Scanner scan = new Scanner(System.in);

             // inputs

             System.out.print("Enter Loan Information : ");

             System.out.print("\nAmount of the loan(any currency) : ");

             loanAmount = scan.nextDouble();

             System.out.print("Annual percentage rate of interest : ");

             annualInterestRate = scan.nextDouble();

             System.out.print("Repayment period of years : ");

             numberOfYears = scan.nextInt();

             // calculate monthly payment, total payment, total interest payemnt

             double monthlyInterestRate = annualInterestRate/1200;

             monthlyPayment = loanAmount*(monthlyInterestRate)/(1-(1/Math.pow(1+monthlyInterestRate, numberOfYears*12)));

             totalPayment = monthlyPayment*(numberOfYears*12);

             totalInterest = totalPayment - loanAmount;

             // outputs

             System.out.printf("\nYour monthly payment will be : %.2f",monthlyPayment);

             System.out.printf("\nYour total payment will be : %.2f",totalPayment);

             System.out.printf("\nYour total interest payments will be : %.2f",totalInterest);

             scan.close();

       }

}

//end of program

Output:

Informati Enter Loan on: Amount of the loan (any currency) 200000 Annual percentage rate of interest 6.5 Repayment period of

Add a comment
Know the answer?
Add Answer to:
this is what it should look like only it is not set to any number you...
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
  • If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but...

    If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but minor discrepancies may require you to adjust. If you are attempting this assignment using another version of Visual Studio, you can expect differences in the look, feel, and/or step-by-step instructions below and you’ll have to determine the equivalent actions or operations for your version on your own. INTRODUCTION: In this assignment, you will develop some of the logic for, and then work with, the...

  • 50. Client-centeredness and humility might look like saying, "Tell me about what's most important to you...

    50. Client-centeredness and humility might look like saying, "Tell me about what's most important to you here." True False 51. Appropriate regression means introducing new tasks weekly. True False 52. Rewarding behaviors, not outcomes means focusing on measurements first. True False 53. A demonstration of your client's mental skills include: Going to the farmer's market, Following the "inner compass" Learning about protein All of the above are correct 54. During step 1 of the coaching process, aim to identify bright...

  • The unadjusted trial balance of Morgan Manufacturing Corp. at December 31, 2019 is shown. Refer also...

    The unadjusted trial balance of Morgan Manufacturing Corp. at December 31, 2019 is shown. Refer also to the additional year-end information for the company shown on the "Adjusting Entries" page (see pictures) Required: 1 Prepare year-end adjusting entries. General ledger account numbers are not necessary. Show your calculations below each adjusting entry. 2 Post the adjusting entries to the trial balance and prepare an adjusted trial balance. 3 Using the amounts from the adjusted trial balance, complete the financial statements...

  • Read this article. Then write a 250 word response on two of the programs you like...

    Read this article. Then write a 250 word response on two of the programs you like the most. Open source business intelligence software 1. BIRT BIRT is an open source BI program that CloudTweaks says is often viewed as the industry standard. BIRT boasts “over 12 million downloads and over 2.5 million developers across 157 countries.” Its users include heavyweights such as Cisco, S1, and IBM (which is also a BIRT sponsor). They also have maturity going for them, as...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

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