madhawaseeeee

paintshape

Sep 17th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1.  
  2. class PaintShape {
  3.  
  4.     String shapeName;
  5.     int coverage;
  6.  
  7.     public PaintShape(String shapeName, int coverage) {
  8.         this.shapeName = shapeName;
  9.         this.coverage = coverage;
  10.  
  11.     }
  12.  
  13.     public double area() {
  14.  
  15.         return 1;
  16.  
  17.     }
  18.  
  19.     public void printShape() {
  20.  
  21.         System.out.println("shapename is " + this.shapeName + "coverage is " + this.coverage);
  22.  
  23.     }
  24.  
  25.     public double amount() {
  26.  
  27.         double area = area();
  28.  
  29.         double amount = area / coverage;
  30.  
  31.         return amount;
  32.  
  33.     }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment