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
29 Days Ago
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,483
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 515
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster
 
0
  #2
29 Days Ago
"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
29 Days Ago
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,483
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 515
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster
 
0
  #4
29 Days Ago
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
29 Days Ago
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,483
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 515
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster
 
0
  #6
29 Days Ago
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
29 Days Ago
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



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC