Question: Complete the program below so that it prompta for an initial amont of money (present value or PV) to deposit into a certificate of depoait

Complete the program below so that it prompta for an initial amont of money (present value or PV) to deposit into a certificate of depoait (CD), the intereat rate INT) for the CD and the number ofyean (YRS) the CD willgrow(uatil maturity). Compute and print out the Auture value of the CD after the given number of years has passed. You should use the following fomula foa future value FV) FV-PV 1 Use the Math.po method shown in section 2.5.3 While the number ofvears may be an mteger, both the amount of money to be deposited and the interest rate should be duble variables. The result FV Complete the following file CDWorth.java should be printed out to two decimal places. 1 import jova.util.Scanner; 4A program that prompts for the present value, interest rate, 6 and then prints the present value and number of years for a certificate of deposit to mature, All variables should be of type double 9 public class COworth 11 ublic static void main (String[] args) 13 14 Display prompt for present volue System.out.print( Please enter the amount to be deposited: " 17 18 Re height of rectangle Sconner in - new Scanner(System.in); double presentVal in.nextDouble); Display prompt for interest rate System.out-print( Please enter the rate of interest: "); // Read rate of Interest double intRatein.nextDouble); // Display prompt for number of years System.out.print( Please enter the number of years: " / Read number of years 28 25 26 int years in.nextint): / Compute and print future value /I Your work here Systen.out.printf("%.2f ", futureVal); 30 31 32 36
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
