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 !!!
import java.lang.Math;
public class E3
{
public static void main(String[] args)
{
Scanner console = new Scanner (System.in);
float x,y,a,b,c,f;
double e;
System.out.println("Enter a ");
a =console.nextDouble();
System.out.println("Enter b ");
b = console.nextDouble();
System.out.println("Enter c ");
c = console.nextDouble();
f= (b*b)-(4*a*c);
e= Math.pow(f, 0.5 );
x=(-b + e)/(2*a);
y=(-b - e)/(2*a);
System.out.println("solution1 =" + x);
System.out.println("solution2 =" + y);
}
}
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