Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. package module5;
  2.  
  3. public class Theory {
  4.    
  5.     // Instance variable
  6.     private double n;
  7.    
  8.     // Constructor to set n
  9.     public Theory(double n){
  10.         this.n = n;
  11.     }
  12.    
  13.     // Get function - Non Static
  14.     public double getN(){
  15.         return this.n;
  16.     }
  17.    
  18.     // Return theoretical y value for given x - Non Static
  19.     public double Y(double x){
  20.         return Math.pow(x, n);
  21.     }
  22.  
  23.     public static void main(String[] args) {
  24.  
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement