JAVA - ONLY DO THE PROBLEM SOLVING PART BELOW.
You just landed a job earning about $60K/year. You vaguely recall one of your professors saying, ‘You should start investing with your first paycheck with $500.00 a month for 40 years to become a millionaire (expected outcome ~$1,000,000.00).
He also said the
average person only works for 40 years, so there is a big cost if
you wait too long to start investing. This is called the Cost of Procrastination (CoP). CoP is the
difference between investing for all forty years or waiting ten
years to start investing and investing for only 30 years (~expected
outcome $500,000.00).
You must use your
Java skills and the Problem-Solving Process to develop a Java
Application to calculate the gain in total investment using the
given compounding-interest equation. You will use an interest rate
of 6% (0.06) and start with a Total Investment of
$2000.00.
ONLY DO THIS. VVVVVVV PLEASE DO NOT USE CODE. JUST DO THIS PART.
I. Understand the Problem:
Problem Statement (Tasks):
Inputs:
Outputs:
Constraints:
Assumptions:
Relevant Equations:
Program
public class investment {
public static void main(String[] args) {
double monthlyInvestment = 2000;
double annualInterestRate =.06;
int year = 40;
int months=year*12;
double monthlyInterestRate=annualInterestRate/12;
double
b=(months*(months+1)/2)*monthlyInterestRate;
double maturityAmount
=(monthlyInvestment*months)+(monthlyInvestment*b);
System.out.printf("Gain in total investment is
$%.2f\n",maturityAmount);
}
}
Output
Gain in total investment is $2114400.00
Get Answers For Free
Most questions answered within 1 hours.