Question

JAVA PLEASE! Suppose you save $100 each month into a savings account with the annual interest...

JAVA PLEASE!

Suppose you save $100 each month into a savings account with the annual interest rate 5%. So, the monthly interest rate is 0.05/12 = 0.00417. After the first month, the value in the account becomes 100 * (1 + 0.00417) = 100.417 After the second month, the value in the account becomes (100 + 100.417) * (1 + 0.00417) = 201.252 After the third month, the value in the account becomes (100 + 201.252) * (1 + 0.00417) = 302.507 and so on. Write a program that prompts the user to enter an amount (e.g., 100), the annual interest rate (e.g., 5), and the number of months (e.g., 6) and displays the amount in the savings account after the given month. SAMPLE RUN: Input the amount: 100 Input the annual interest rate (e.g., 5 for 5%): 5 Input the number of months: 6 OUTPUT: The balance after 6 months is 608.81

0 0
Add a comment Improve this question Transcribed image text
Answer #1
import java.util.Scanner;

public class CalculateIntereset {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("Input the amount: ");
        double amount = in.nextDouble();
        System.out.print("Input the annual interest rate (e.g., 5 for 5%): ");
        double rate = in.nextDouble() / 1200;
        System.out.print("Input the number of months: ");
        int n = in.nextInt();
        double total = 0;
        for(int i = 0; i < n; ++i) {
            total = (amount + total) * (1 + rate);
        }
        System.out.printf("The balance after %d months is %.2f\n", n, total);
    }

}

'

Add a comment
Know the answer?
Add Answer to:
JAVA PLEASE! Suppose you save $100 each month into a savings account with the annual interest...
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
  • 5.31 (Financial application: compute CD value) Suppose you put $10,000 into a CD with an annual...

    5.31 (Financial application: compute CD value) Suppose you put $10,000 into a CD with an annual percentage yield of 5.75%. After one month, the CD is worth 10000 + 10000 * 5.75 / 1200 = 10047.92 After two months, the CD is worth 10047.91 + 10047.91 * 5.75 / 1200 = 10096.06 After three months, the CD is worth 10096.06 + 10096.06 * 5.75 / 1200 = 10144.44 and so on. Write a program that prompts the user to enter...

  • LULUPULUS! WORK AREA Suppose you have a certain amount of money in a savings account that...

    LULUPULUS! WORK AREA Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula is as follows: f=p* (1 + i)^t • fis the future value of the account after the specified time period. •p is the present value of the account. i is the monthly interest rate. .t is the number of months How...

  • C++ 18. Savings Account Balance Write a program that calculates the balance of a savings account...

    C++ 18. Savings Account Balance Write a program that calculates the balance of a savings account at the end of a three month period. It should ask the user for the starting balance and the annual interest rate. A loop should then iterate once for every month in the period, performing the following A) Ask the user for the total amount deposited into the account during that month. Do not accept negative numbers. This amount should be added to the...

  • solve this JAVA problem in NETBEANS Problem #12 in page 400 of your text (6th edition): SavingsAccount Class. Design a SavingsAccount class that stores a savings account's annual interest rate...

    solve this JAVA problem in NETBEANS Problem #12 in page 400 of your text (6th edition): SavingsAccount Class. Design a SavingsAccount class that stores a savings account's annual interest rate and balance. The class constructor should accept the amount of the savings account's starting balance. The class should also have methods for subtracting the amount of a withdrawal, adding the amount of a deposit, and adding the amount of monthly twelve. To add the monthly interest rate to the balance,...

  • Suppose you have a certain amount of money in a savings account that earns compound monthly...

    Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula is as follows: f = p * (1 + i)^t • f is the future value of the account after the specified time period. • p is the present value of the account. • i is the monthly interest rate. • t is the...

  • A savings plan is set up so that $100 is placed into an account on the...

    A savings plan is set up so that $100 is placed into an account on the 1st and 15th of each month. The first payment was made on January 1, 2010 and this continued until December 1, 2013. Then no money was deposited for the rest of December 2013 until March 1, 2014 when the $100 payments were continued until the last payment was made on February 1, 2017. Interest is 2.5% effective annual interest. a. Draw a careful number...

  • If Jackson deposits $100 at the end of each month in a savings account earning interest...

    If Jackson deposits $100 at the end of each month in a savings account earning interest at a rate of 3%/year compounded monthly, how much will he have on deposit in his savings account at the end of 6 years, assuming he makes no withdrawals during that period? (Round your answer to the nearest cent.)

  • the graph shows the amount of money in a savings account each month. Based on the...

    the graph shows the amount of money in a savings account each month. Based on the data, which is the best prediction for the amount of money in the account after 8 months? soo 1 Amolt 450 400 350 300 250 N 200 150 100 50 CE 1 2 3 4 5 6 7 8 Months 2 800 O $100 O $200 $300 $400

  • Assume that you open a savings account that accrues 3% nominal annual interest that is compounded...

    Assume that you open a savings account that accrues 3% nominal annual interest that is compounded monthly. Initially, your account has no funds in it. Starting next month, you add $100 / month for 6 months. Then, starting in the 7th month, you increase your monthly deposit by $25 each month from the month before for the following 18 months (i.e. month 7 deposit = $125). At the end of the second year, what will be the present worth of...

  • i need this to be in OOP using C++ 25. Savings Account Balance Write a program...

    i need this to be in OOP using C++ 25. Savings Account Balance Write a program that calculates the balance of a savings account at the end of a three-month feried. It should ask the user for the starting balance and the annual interest rate. A loop abculd then iterate once for every month in the period, performing the following steps: B) A) Ask the user for the total amount deposited into the account during that month and add it...

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