Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. public static void Question2()
  2.     {
  3.         double math;
  4.         String answer;
  5.         answer = "yes";
  6.         answer = "no";
  7.         Scanner sqrt = new Scanner(System.in);
  8.         Scanner ans = new Scanner(System.in);
  9.         System.out.print("Enter a number: ");
  10.         math = sqrt.nextDouble();
  11.         Math.sqrt(math);
  12.         Math.pow(math, 2);
  13.         Math.pow(math, 1/3);
  14.         Math.cbrt(math);
  15.         Math.pow(math, 3);
  16.         System.out.println("The square root of "+math+ " is "+Math.sqrt(math));
  17.         System.out.println("The cube root of "+math+" is "+Math.cbrt(math));
  18.         System.out.println("The square of "+math+" is "+Math.pow(math,2));
  19.         System.out.println("the cube of "+math+" is "+Math.pow(math, 3));
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement