Advertisement
Guest User

asdfasd

a guest
Apr 28th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1.  
  2. public class Trapzoid extends parallelograms {
  3. private double sideC,sideD;
  4. public Trapzoid() {
  5. sideC=1;
  6. sideD=1;
  7. }
  8.  
  9. public Trapzoid(double a, double b, double h,double c,double d) {
  10. super(a, b, h);
  11. sideC=c;
  12. sideD=d;
  13. }
  14. public double getC(){
  15. return sideC;
  16. }
  17. public void setC(double c){
  18. sideC=c;
  19. }
  20. public double getD(){
  21. return sideD;
  22. }
  23. public void setD(double d){
  24. sideD=d;
  25. }
  26.  
  27. public double findArea(){
  28. return super.getH()*((super.getSide()+sideC)/2);
  29. }
  30. public double findP(){
  31. return super.getSide()+super.getWid()+sideC+sideD;
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement