Hello I am attempting to write a program that calculates a future investment value using a fixed rate and I am having issues with my variables. Any help would be much appreciated thank-you ahead of time!
/**
* NAME:
* DATE: November 3, 2015
* FILE:
* COMMENTS: This program caculates a future investment value using a fixed rate
*/
import java.util.Scanner;
public class lab12
{
public static void main(String[] args)
{
//declare variables
double yearlyInterstRate;
double monthlyInterestRate;
double monthlyInvestmentAmount;
double years;
double months;
//Create Scanner Object
Scanner keyboard= new Scanner(System.in);
//Get Investment Information
System.out.print("Hello we will be caculating the future of your fixed monthly investment, I will need to collect some information from you.");
System.out.print("What is your monthly investment amount?");
monthlyInvestmentRate=keyboard.nextLine();
System.out.print("How many years wil you be investing for?");
years=keyboard.nextLine();
System.out.print("What is your yearly interest rate?");
yearlyInterestRate=keyboard.nextLine();
//Caculate the future rate
{
months=years*12;
monthlyInterestRate=yearlyInterestRate/12/100;
futureValue= CaculateFuturevalue(monthlyInvestedAmount,monthlyInterestRate,months);
System.out.print("Your future value is $"+futureValue);
}
} //Close Main
} //close lab12