Question:

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

by  |  earlier

0 LIKES UnLike

/**

* @(#)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)

 Tags:

   Report

2 ANSWERS


  1. Change it

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

    good luck


  2. i think pow works only for integers

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.