I really need help,please

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2009
Posts: 4
Reputation: somewhere is an unknown quantity at this point 
Solved Threads: 0
somewhere somewhere is offline Offline
Newbie Poster

I really need help,please

 
0
  #1
Nov 6th, 2009
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);
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,506
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 521
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster
 
0
  #2
Nov 6th, 2009
"It didn't work" is not a question.

And use code tags if you post code.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 4
Reputation: somewhere is an unknown quantity at this point 
Solved Threads: 0
somewhere somewhere is offline Offline
Newbie Poster
 
0
  #3
Nov 6th, 2009
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 ,,
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,506
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 521
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster
 
0
  #4
Nov 6th, 2009
And what is your question? As I said, "it doesn't work" is not a question. Be specific.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 4
Reputation: somewhere is an unknown quantity at this point 
Solved Threads: 0
somewhere somewhere is offline Offline
Newbie Poster
 
0
  #5
Nov 6th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,506
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 521
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster
 
0
  #6
Nov 6th, 2009
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 .
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 4
Reputation: somewhere is an unknown quantity at this point 
Solved Threads: 0
somewhere somewhere is offline Offline
Newbie Poster
 
0
  #7
Nov 6th, 2009
ok I correct it ,,
but just one more question ,,
in the statment :
  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
Reply With Quote Quick reply to this message  
Reply

Message:



Other Threads in the Java Forum
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC