plllllzzz hellp me before next Suterday

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

Join Date: Nov 2009
Posts: 6
Reputation: GiRL,IT is an unknown quantity at this point 
Solved Threads: 0
GiRL,IT GiRL,IT is offline Offline
Newbie Poster

plllllzzz hellp me before next Suterday

 
-3
  #1
30 Days Ago
hi guyz and GiRlzz (F) ;;

how R u ?

plllz I need 4 helpping from u !!

I've a Q in Java ,, I'm trying to write it in jGRASP but I can't :s

plllllzzz hellp me before next Suterday ;s

this is my Q


3.Write expressions to compute both solutions for the quadratic formula. The formula is
- b + - ( b^2 - 4ac) / 2a
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 is my answer but when put it in jGRASP , it tell me ERROR !!!

  1. import java.lang.Math;
  2.  
  3. public class E3
  4. {
  5. public static void main(String[] args)
  6. {
  7. Scanner console = new Scanner (System.in);
  8.  
  9. float x,y,a,b,c,f;
  10. double e;
  11.  
  12. System.out.println("Enter a ");
  13. a =console.nextDouble();
  14.  
  15. System.out.println("Enter b ");
  16. b = console.nextDouble();
  17.  
  18. System.out.println("Enter c ");
  19. c = console.nextDouble();
  20.  
  21. f= (b*b)-(4*a*c);
  22. e= Math.pow(f, 0.5 );
  23.  
  24. x=(-b + e)/(2*a);
  25. y=(-b - e)/(2*a);
  26.  
  27. System.out.println("solution1 =" + x);
  28. System.out.println("solution2 =" + y);
  29. }
  30. }



and this is another Q

2.Write a java program that reads two integers into the variables a and b then swaps the values of a and b.


I'm so sorry :;s
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 147
Reputation: anuj576 is an unknown quantity at this point 
Solved Threads: 10
anuj576 anuj576 is offline Offline
Junior Poster
 
0
  #2
30 Days Ago
Can you please brief us on the error that you are getting.
Thanks & Regards,
Anuj Sharma
Future Software Engineer
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 17
Reputation: stevelg is an unknown quantity at this point 
Solved Threads: 5
stevelg stevelg is offline Offline
Newbie Poster
 
0
  #3
30 Days Ago
I notice you are using the standard float numbers and the newer double format which may be the cause of your problems. If so, you may need to cast the double values input into FLOAT to asign them to the declared variables. Alternatively, you could use Double precision throughout the program.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 4
Reputation: mruthyunjaya is an unknown quantity at this point 
Solved Threads: 0
mruthyunjaya mruthyunjaya is offline Offline
Newbie Poster
 
0
  #4
30 Days Ago
Originally Posted by GiRL,IT View Post

2.Write a java program that reads two integers into the variables a and b then swaps the values of a and b.
  1.  
  2. public class swapInts
  3. {
  4. public static void main(String[] args)
  5. {
  6. Scanner console = new Scanner (System.in);
  7.  
  8. int a, b, tempInt;
  9.  
  10. System.out.println("Enter first Int: ");
  11. a =console.nextInt();
  12.  
  13. System.out.println("Enter second Int: ");
  14. b = console.nextInt();
  15.  
  16. tempInt = a; //copy a to temp
  17. a = b; //copy b to a
  18. b = tempInt; //copy temp to b
  19.  
  20. System.out.println("int 1=" + a);
  21. System.out.println("int 2 =" + b);
  22. }
  23. }

hope this helps...
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 6
Reputation: GiRL,IT is an unknown quantity at this point 
Solved Threads: 0
GiRL,IT GiRL,IT is offline Offline
Newbie Poster
 
-2
  #5
28 Days Ago
anuj576 & stevelg

THX 4 u ,, I solved Q 3 and I knw where is my erorr ^^



mruthyunjaya

Thhhhhhhhhhhhhhhnk u

you've helped me thhhx huuuun (F)(F) u'r a heRo


I'v a Q

what's meaning of tempInt in

  1. int a, b, tempInt;
  2. tempInt = a; //copy a to temp
  3. b = tempInt; //copy temp to b


Finelly ^^ R u sure from da code ?

thx again
Last edited by GiRL,IT; 28 Days Ago at 3:40 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,197
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 485
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer
 
-1
  #6
28 Days Ago
@GiRL,IT your use of language is unacceptable. Please make sure you read forum rules where you will find something like
We strongly encourage all posts to be in full-sentence English. Please do not use "leet" speak or "chatroom" speak.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 6
Reputation: GiRL,IT is an unknown quantity at this point 
Solved Threads: 0
GiRL,IT GiRL,IT is offline Offline
Newbie Poster
 
-1
  #7
28 Days Ago
^

okay dear .

I'll do That
Last edited by GiRL,IT; 28 Days Ago at 4:43 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 4
Reputation: mruthyunjaya is an unknown quantity at this point 
Solved Threads: 0
mruthyunjaya mruthyunjaya is offline Offline
Newbie Poster
 
0
  #8
28 Days Ago
Originally Posted by GiRL,IT View Post
mruthyunjaya

Thhhhhhhhhhhhhhhnk u

you've helped me thhhx huuuun (F)(F) u'r a heRo


I'v a Q

what's meaning of tempInt in

  1. int a, b, tempInt;
  2. tempInt = a; //copy a to temp
  3. b = tempInt; //copy temp to b


Finelly ^^ R u sure from da code ?

thx again
tempInt is just a temporary Integer. we use that to store either a or b value in the process of swapping... hope i am clear..
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 6
Reputation: GiRL,IT is an unknown quantity at this point 
Solved Threads: 0
GiRL,IT GiRL,IT is offline Offline
Newbie Poster
 
0
  #9
28 Days Ago
^

thank you

yes ,you could clear for me
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC