944,131 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 471
  • Java RSS
Nov 6th, 2009
0

I really need help,please

Expand Post »
heey all ,,
I'v a question about the pow ,, but when I run the programe it didn't work =S
I really need help because tomorrow I shloud give it to my teacher,,

********************************************
import java.lang.Math;
public class ques3
{
public static void main(String[]args)
{
static Scanner console = new Scanner(System.in);
float a,b,c;
System.out.println("Enter a ");
a=console.nextFloat();
System.out.println("Enter b ");
b=console.nextFloat();
System.out.println("Enter c ");
c=console.nextFloat();
sum=Math.Pow((double)b*b-4*a*c,0.5);
Reputation Points: 10
Solved Threads: 0
Newbie Poster
somewhere is offline Offline
4 posts
since Nov 2009
Nov 6th, 2009
0
Re: I really need help,please
"It didn't work" is not a question.

And use code tags if you post code.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Nov 6th, 2009
0
Re: I really need help,please
3. Write expressions to compute both solutions for the quadratic formula. The formula is (b^2-4ac)^0.5

The symbol means “plus or minus” and indicates that the equation has two solutions: one in which the result of the square root is added to -b and one in which the result is subtracted from -b. Assume all variables are float variables.

this it the question ,,
Reputation Points: 10
Solved Threads: 0
Newbie Poster
somewhere is offline Offline
4 posts
since Nov 2009
Nov 6th, 2009
0
Re: I really need help,please
And what is your question? As I said, "it doesn't work" is not a question. Be specific.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Nov 6th, 2009
0
Re: I really need help,please
oh !!
please I asked for help be kind with me =S

my question is : what is the wrong in my code ?! why it doesn't run ?!

hope am clear
Reputation Points: 10
Solved Threads: 0
Newbie Poster
somewhere is offline Offline
4 posts
since Nov 2009
Nov 6th, 2009
0
Re: I really need help,please
The compiler is usually very explicit in telling you what the problem is.

At a quick glance, one problem is that you used "Pow" instead of "pow". Java is case sensitive .
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Nov 6th, 2009
0
Re: I really need help,please
ok I correct it ,,
but just one more question ,,
in the statment :
Java Syntax (Toggle Plain Text)
  1. System.out.println("the value="+sum);

how can I say before this statment ?
sum=console.nextdouble ?!
or what ?!

sorry but I'm not a perfect in java
Reputation Points: 10
Solved Threads: 0
Newbie Poster
somewhere is offline Offline
4 posts
since Nov 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Incompatible types found (HELP!)
Next Thread in Java Forum Timeline: How to implement a sample saas application





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC