Question: Write a Java program that reads an annual cash flow of 10 years and calculates net present value (NPV) of the 10-year cash flows. The

Write a Java program that reads an annual cash flow of 10 years and calculates net present value (NPV) of the 10-year cash flows. The program must read an interest rate to calculate the NPV. Use a loop statement.

Sample Inputs/ outputs:

Enter your annual cash flow:

100

Enter an interest rate:

0.01

NPV = 947.1305

I have already finished most of the code, but I cannot add the sum of the NPVs together. How can I go about doing this? I need to add all 10 sums, but I have to use the loop statement as well.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!