Question: Write a Java program called Lottery.java Description Assume a person wins the lottery and is given the choice of receiving a lump sum or annual
Write a Java program called Lottery.java
Description
Assume a person wins the lottery and is given the choice of receiving a lump sum or annual payments. Prompt the user to enter the lump sum amount amtLump the annual payment pmt the interest rate in decimal Eg enter instead of and the number of payments n Create a method called calcPV to calculate today's value of the annual payments pv Call the calcPV method from the main method using the parameters values given by the user pmt r n and store the return value into a double variable pv Display amtLump, pv and a message indicating which option is better.
You are REQUIRED to use a method to calculate pv Any submissions without the calcPV method will receive NO credit.
Sample runs and an Excel spreadsheet to test your calculations are attached. The formula to calculate pv is shown below:
pv : present value
pmt: annual payment
: interest rate in decimals eg
n : number of years
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
