• 0

[JAVA] Square Root


Question

I need help with how to code for a square root..

Suppose to be "Area = Square root of S(S - Length1)(S - Length2)(S - Length3)"

I have:

	 if (Area = Math.sqrt(S(S - Length1)(S - Length2)(S - Length3)));

Not working as I get multiple errors.

 ----jGRASP exec: javac -g C:\Documents and Settings\Administrator\My Documents\JAVA\MyTriangle.java

MyTriangle.java:42: ')' expected
	 if (Area = Math.sqrt(S(S - Length1)(S - Length2)(S - Length3)));
										^
MyTriangle.java:42: not a statement
	 if (Area = Math.sqrt(S(S - Length1)(S - Length2)(S - Length3)));
										   ^
MyTriangle.java:42: ';' expected
	 if (Area = Math.sqrt(S(S - Length1)(S - Length2)(S - Length3)));
													^
MyTriangle.java:42: not a statement
	 if (Area = Math.sqrt(S(S - Length1)(S - Length2)(S - Length3)));
														^
MyTriangle.java:42: ';' expected
	 if (Area = Math.sqrt(S(S - Length1)(S - Length2)(S - Length3)));
																 ^
5 errors

Double posted, apologies.

Double posted, apologies.

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.