what's wrong with my java program? HELP!!?

what’s wrong with my java program? HELP!!?
/**
* @(#)exponent.java
*
*
* @author
* @version 1.00 2008/8/18
*/
import java.lang.Math.*;
import java.io.*;
import java.util.*;
public class exponent {
static Scanner console = new Scanner(System.in);
public static void main(String[]args) {

double x,y,answer;

System.out.print(“enter 2 nums: “);
x = console.nextDouble();
y = console.nextDouble();

answer = pow((double)x, (double)y);
System.out.printf(“%.2f”,answer);
}

}

THIS IS THE ERROR: cannot find symbol method pow(double,double)

Best answer:

i think pow works only for integers

Tags: , , , ,

Under Forum

1 Comment for what's wrong with my java program? HELP!!?

  • 1. ?  |  January 14th, 2008 at 1:30 am

    Change it

    answer = Math.pow((double)x, (double)y);

    good luck

Leave a Comment for what's wrong with my java program? HELP!!?

Required

Required, hidden

Trackback this post  |  Subscribe to the comments via RSS Feed


Forum