Question
The pseudocode below calculates the future value of a fixed monthly investment. The user enters fixed monthly investment, yearly interest rate, and number of years
The pseudocode below calculates the future value of a fixed monthly investment. The user enters fixed monthly investment, yearly interest rate, and number of years invested. The program then calculates and displays the future value. Review the pseudocode and convert it to a java program named lab12.java.
start
num yearlyInterestRate num monthlyInterestRate num monthlyInvestmentAmount num years num months input monthlyInvestmentAmount input years input yearlyInterestRate months = years x 12; monthlyInterestRate = yearlyInterestRate / 12 / 100; futureValue = CalculateFutureValue(monthlyInvestmentAmount,monthlyInterestRate, months) print "Future Value $" , futureValue
stop
num CalculateFutureValue(num monthlyInvestment, num monthlyInterestRate, num months ) num futureValue = 0; num monthcount=0; while monthcount < months futureValue = (futureValue + monthlyInvestment) x (1 + monthlyInterestRate); monthcount = monthcount + 1; end while return futureValue;
Output sample Enter monthly investment amount: 100.0 Enter number of years: 15 Enter yearly interest rate: 4.5
Future Value $25737.62238457704
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