inherit
86062
0
Aug 12, 2014 6:53:34 GMT -8
Diego Zelaya
526
August 2006
alonendarain
|
Post by Diego Zelaya on Jan 27, 2012 18:24:36 GMT -8
Hey guys. I am trying to write up a code and it is not working on eclipse. here it is listed
import java.util.Scanner; public class ProgramExercise13 { public static void main(String [] args) { Scanner input = new Scanner(System.in);
System.out.print("Enter investment amount: "); double investmentAmount = input.nextDouble();
System.out.print("Enter annual interest rate: "); double annualInterestRate = input.nextDouble();
System.out.print("Enter number of years: "); double numberOfYears = input.nextDouble ();
double futureInvestmentValue = investmentAmount * (1 + annualInterestRate) Math.pow(1 + annualInterestRate, numberOfYears * 12);
System.out.println("Accumulated value is " + futureInvestmentValue);
The error I am getting is "Exception in thread "main" java.lang.Error: Unresolved compilation problem: Syntax error, insert ";" to complete LocalVariableDeclarationStatement"
If anyone can help me on this, I would greatly appreciate it!
|
|
inherit
24252
0
Aug 1, 2023 15:01:24 GMT -8
coolcoolcool
When the world says, "Give up," Hope whispers, "Try it one more time."
2,148
May 2004
coolcoolcool
|
Post by coolcoolcool on Jan 27, 2012 20:08:22 GMT -8
This:
double futureInvestmentValue = investmentAmount * (1 + annualInterestRate) Math.pow(1 + annualInterestRate, numberOfYears * 12);
Notice how Math.pow is written right after ), add some sort of arithmetic symbol there like + or *.
|
|