# ')' and ';' error

• October 1st, 2013, 03:06 PM
MLIAKIRA
')' and ';' error
So I need to find the monthly payment for a motgage and I can't seem to find what is wrong with my equation, someone help please!

monthlyPayment = taxRate * loanAmount * ((Math.pow(1+taxRate, months)) / (Math.pow((1+taxRate, months)-1)));
• October 1st, 2013, 03:46 PM
Norm
Re: ')' and ';' error
Quote:

what is wrong with my equation
Can you explain why you think there is something wrong?
Where did you get the equation? Can you copy the full text of the equation you are trying to code and paste it here. If there are errors, Please copy the full text of the error message and paste it here.
• October 1st, 2013, 03:51 PM
MLIAKIRA
Re: ')' and ';' error
Oh I guess I didn't really state that clearly. We have to calculate a monthly mortgage and my professor gave me this equation we have to use and its

monthly payment = rate x amount x (1+rate)^months / ((1+rate)^months)-1

Attachment 2340

and this is the equation I used in my program

monthlyPayment = taxRate * loanAmount * (((Math.pow(1+taxRate, months)) / (Math.pow((1+taxRate, months)-1)));

I get the red bar under it and the only error says " ')' expected " error
• October 1st, 2013, 04:02 PM
MLIAKIRA
Re: ')' and ';' error
here is a pic of my code if that helps

Attachment 2341
• October 1st, 2013, 04:04 PM
Norm
Re: ')' and ';' error
Quote:

I get the red bar under it
Please copy full text of the compiler's error message and paste it here.
The message should show the source with a ^ under the location of the error.
Here is a sample from the javac compiler:
Code :

```TestSorts.java:138: cannot find symbol symbol : variable var location: class TestSorts var = 2; ^```
• October 1st, 2013, 04:20 PM
MLIAKIRA
Re: ')' and ';' error
How do I do that? I hover my mouse over the red bar and it says ')' unexpected

--- Update ---

Compiling 1 source file to E:\MortgageCaculation\build\classes
E:\MortgageCaculation\src\mortgagecaculation\Mortg ageCaculation.java:44: error: ')' expected
monthlyPayment = taxRate * loanAmount * (((Math.pow(1+taxRate, months)) / (Math.pow((1+taxRate, months)-1)));
1 error
E:\MortgageCaculation\nbproject\build-impl.xml:926: The following error occurred while executing this line:
E:\MortgageCaculation\nbproject\build-impl.xml:268: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 2 seconds)
• October 1st, 2013, 04:23 PM
Norm
Re: ')' and ';' error
I don't see the ^ that points to the location of the error.

Check that the ()s are correctly positioned. Perhaps add some spaces to isolate different parts of the equation so you can easily see if the ()s are in the correct places.
• October 1st, 2013, 04:32 PM
MLIAKIRA
Re: ')' and ';' error
trust me ive been trying. I use netbeans so maybe its different but i cant find anywhere a compile button.
• October 1st, 2013, 04:37 PM
Norm
Re: ')' and ';' error
I don't know anything about your IDE. I use the javac command to compile my java programs. In many cases it gives better error messages than IDEs do.

--- Update ---

Did you check the ()s as I suggested?