Question

Write a program in java to compute the monthly payment for investment for different interest rate....

Write a program in java to compute the monthly payment for investment for different interest rate. One for 5 years and another for 10 years, the initial rate is 3.75% with an increment of 0.025%

P= r*(pv)/1-(1+r)^-n

P= payment

R= interest rate

Pv =Investment

0 0
Add a comment Improve this question Transcribed image text
Answer #1
import java.util.Scanner;
public class investment{
 
 public static void main(String[] args) {
    Scanner in1 = new Scanner(System.in); 
    System.out.print("Payment amount: "); 
    double pmt = in1.nextDouble();
    System.out.print("Investment amount: ");
        double investmnt = in1.nextDouble();
        System.out.print("Rate of interest: ");
        double rate1 = in1.nextDouble();
        System.out.print("Number of years: ");
        int year1 = in1.nextInt();
        
        rate1 *= 3.75;
        
        System.out.println("Years    monthlyValue");
        for(int j = 1; j <= year; j++) {
        int formatter1 = 5;
            if (j >= 5) formatter1 = 10;
                System.out.printf(i + "%"+formatter1+".2f\n", monthlyValue(investmnt, rate1/12, j));
       }
         }
 
 public static double monthlyValue(double P, double monthlyrateofinterest, int years) {
                return P= monthlyrateofinterest*(pmt*investmnt)/1-(1+monthlyrateofinterest)pow(-n), years * 12);
        }
} 
Add a comment
Know the answer?
Add Answer to:
Write a program in java to compute the monthly payment for investment for different interest rate....
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
  • In C. Thank you! Bank Write a program to calculate the monthly payment on a loan...

    In C. Thank you! Bank Write a program to calculate the monthly payment on a loan given the loan amount, interest rate and the number of years to pay off the loan. Then add a function to print an amortization schedule for that loan. Create a class to save the current balance and the rest of the data as private data. Add member functions to make a payment and to print the amortization report. Use the following class header. Class...

  • The program is in python :) Write a code program to calculate the mortgage payment. The...

    The program is in python :) Write a code program to calculate the mortgage payment. The equation for calculating the mortgage payment is: M = P (1+r)n (1+r)n-1 Where: M is your monthly payment P is your principal r is your monthly interest rate, calculated by dividing your annual interest rate by 12. n is your number of payments (the number of months you will be paying the loan) Example: You have a $100,000 mortgage loan with 6 percent annual...

  • Program Specification: This project involves implementing a Java program that performs a calculation of payments associated...

    Program Specification: This project involves implementing a Java program that performs a calculation of payments associated with loans. The program shall allow a user to enter the following data: annual interest rate the loan (i.e. , number of years), and the loan amount. A GUI like the one below must be used. Loan Calculator Annual Interest Rate: Number of Years Loan Amount: Monthly Payment Total Payment Calculate When the user presses the calculate button, the monthly payment and total amount...

  • using Matlab program: Create a loan payment program that can be used for any loan amount...

    using Matlab program: Create a loan payment program that can be used for any loan amount such as a home or car loan. The program should ask the user for the input values below, compute the monthly payment, then compute the monthly balance. Display the balance in a table Month             Balance 1                      $ ##.## 2                      $ ##.## 3                      $ ##.##       . . . etc Use the formula PMT=P*(r(1+r)^n)/((1+r)^n-1) PMT = the monthly payment. P = the principal r = the interest rate per month, which...

  • c++ and please add tables and everything and make sure program is complete. Write a menu...

    c++ and please add tables and everything and make sure program is complete. Write a menu driven program, which would compute compound interest and a monthly payment for a loan. The user will be given a choice to display the info on the screen or to a filo Menu will be the following Enter (1) to calculate your loan monthly payment Enter (2) to calculate your loan monthly payment & write to a file Tips: Compound Interest Formula A =...

  • 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,...

  • PYTHON ONLY PLEASE (Financial application: compare loans with various interest rates) Write a program that lets...

    PYTHON ONLY PLEASE (Financial application: compare loans with various interest rates) Write a program that lets the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8%, with an increment of 1/8. Sample Run Loan Amount: 10000 Number of Years: 5 Interest Rate Monthly Payment Total Payment 5.000% 188.71 11322.74 5.125% 189.29 11357.13 5.250% 189.86 11391.59 ... 7.875% 202.17 12129.97 8.000% 202.76...

  • Write a python program for the below question? Car Loan If A dollars is borrowed at...

    Write a python program for the below question? Car Loan If A dollars is borrowed at r% interest compounded monthly to purchase a car with monthly payments for n years, then the monthly payment is given by the formula monthly payment = i / 1 - (1 + i)-12n . A where i = r/1200. Write a program that calculates the monthly payment after the user gives the amount of the loan, the interest rate, and the number of years.

  • An investment with an initial deposit of $2,654 is growing at an interest rate of 7.23%...

    An investment with an initial deposit of $2,654 is growing at an interest rate of 7.23% compounded semi- annually. Round all answers to two decimal places if necessary. 1. Find the accumulated amount of the investment at the end of 3 years. P/Y - C/Y - N = 1/Y - PV = $ PMT= $ FV - $ 2. The interest rate changes to 4.16% compounded quarterly after the first 3 years. Calculate the accumulated amount in this investment at...

  • Use the PMT function in Excel to compute the monthly payment on a $328000 business loan...

    Use the PMT function in Excel to compute the monthly payment on a $328000 business loan at an annual interest rate of 7.15% over 20 years, where the interest is compounded monthly. Hint: The PMT (Payment) function is entered in Excel as =PMT(Rate, Nper, Pv, Fv, Type) Fv and Type are not necessary. Ignore them. Enter the amount of your monthly payment below. Do not include the dollar sign ($)

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