RazorBlade57

Slope

Oct 17th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. public class Slope {
  2.    
  3.     private int xone,xtwo,yone,ytwo,m;
  4.    
  5.     public Slope(int x, int y, int x2, int y2){
  6.         xone = x;
  7.         xtwo = x2;
  8.         yone = y;
  9.         ytwo = y2;
  10.         }
  11.  
  12.     public void equation(){
  13.        
  14.         m = ((ytwo - yone)/ (xtwo - xone));
  15.         }
  16.    
  17.     public void print(){
  18.        
  19.         System.out.println("The slope of the line is :: " + m);
  20.        
  21.     }
  22. }
Add Comment
Please, Sign In to add comment