Advertisement
MikelRent

Ex. 8.13

Nov 24th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class E813
  3. {
  4.     private double x;
  5.     private int y;
  6.    
  7.     public static void main(String[] args)
  8.     {
  9.         Scanner scan = new Scanner(System.in);
  10.         System.out.println("enter integer here:");
  11.         scan = new Scanner();
  12.     }
  13.     if (y < 0)
  14.     {
  15.         x = -1 / (Math.pow(x, y));
  16.     }
  17.     if (y.isEven && y.isPositive)
  18.     {
  19.         x = Math.pow(x, y/2);
  20.     }
  21.     if (y.isOdd && y.isPositive)
  22.     {
  23.         x = Math.pow(x, y-1);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement