madhawaseeeee

paintshape2

Sep 17th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1.  
  2. abstract 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  abstract double area();
  14.  
  15.     public void printShape() {
  16.  
  17.         System.out.println("shapename is " + this.shapeName + "coverage is " + this.coverage);
  18.  
  19.     }
  20.  
  21.     public double amount() {
  22.  
  23.         double area = area();
  24.  
  25.         double amount = area / coverage;
  26.  
  27.         return amount;
  28.  
  29.     }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment