Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Suppose you deposit $100 each month into a savings account with the annual interest rate 5%, thus, the monthly interest rate is 0.05112 = 0.00417.
Suppose you deposit $100 each month into a savings account with the annual interest rate 5%, thus, the monthly interest rate is 0.05112 = 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 method called accountValue that takes in 3 parameters: the monthly saving amount, the annual interest rate, and number of months, and the method returns the value in the account after that many months. Use the following method header: public static double accountValue(double monthlyAmount, doubls.I annualRate, int months) Also write how this method w0uld be called in your main method. Name y0ur program AccountTestYourLastName.java In the main method, prompt the user for monthly saving amount, the annual interest rate, and the number of months, call the accOuntValue method and Output value in the account {2 decimal places). Sample Output Enter your monthly saving amount: 100 Enter annual interest rate (e.g. enter 5 for 5%): 5 Enter number of months you want to save: 24 The value in your account after 24 months is: $2529.09
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started