Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1: Future Value of Periodic Investments (10pt) Suppose you keep investing $1000 into a mutual fund at the beginning of each month, and the

image text in transcribed

Exercise 1: Future Value of Periodic Investments (10pt) Suppose you keep investing $1000 into a mutual fund at the beginning of each month, and the fund's annual rate of return is 12%, which is 1% per month. By the end of the fifth year, how much money will you have in the mutual fund? This is a typical example of the future value of periodic investments. Write a simple Java program to calculate the future value of periodic investments. Save it as Hw2_Ex1.java. Your program should be able to do the following: (i) Prompt the user to enter the amount of investment each period, read in the value and save it to a variable; Prompt the user to enter the rate of return each period, read in the value and save it to a variable; Prompt the user to enter the total number of periods, read in the value and save it to a variable; Calculate the future value using the following formula, and display the result on the screen (only display two digits after the decimal point). (Hint: use printf) (1+r)n+1 - (1 + r) FV = M: Amount of investment per period r: rate of return per period n: Total number of periods Example: The answer to the above example is $82,486.37. If your program is correct, your output should look like the following: 05. Command Prompt C:\test>javac Hw2_Ex1.java C:\test>java Hw2_Ex1 Amount of Periodic Investment: 1000 Rate of Return per Period: 0.01 Number of Periods: 60 Future Value : 82486.37 C: \test. Hints: The following (partial) statements may be useful import java.util.Scanner; Scanner input = new Scanner (System.in); ... input.nextDouble() ... Also, you will need to use the Math.pow (x, y) and Math.sqrt(x) method

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions