Katrina Cobb

Greenhorn
+ Follow
since Sep 22, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Katrina Cobb

ok.... I suppose I do deserve a smack on the head
17 years ago
It won't work for me. When I put in a value for x, it prints out the same value instead of giving me the square root. I took away the Math.pow method and just used square root method and it worked. Which is fine, but I'm afraid when I put the entire formula in (square root of (7x^4 + 5x^3 + 3x^2 + x), it isn't going to compile the right way. I'm told I have to use the power method. So I'm kinda stumped.
17 years ago
How do I get the square root of a number? I put:

int x;
double discriminant, result;
Scanner scan = new Scanner (System.in);
System.out.print ("Enter value of x: ");
x = scan.nextInt();
discriminant = Math.pow(x, 2);
result = (Math.sqrt(discriminant));
System.out.print ("Result is: " + result);
17 years ago
I feel like an idiot for not thinking of that
...thanks!
17 years ago
I'm trying to write a program to calculate for any positive value of x. I have to use the expression: square root of(7x^4 + 5x^3 + 3x^2 + x). I have it up till the part where I have to incorporate the sqrt() and pow() methods in order to get the answer. Any advice? Thanks...
17 years ago