Guest User

вес твари

a guest
Apr 14th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. abstract public class SomeZooWeight {
  2. int addend;
  3. int multiplier;
  4. double weight;
  5.  
  6. public SomeZooWeight (int addend,int multiplier){
  7. this.addend = addend;
  8. this.multiplier = multiplier;
  9. weight = addend + multiplier * Math.random();
  10. }
  11. }
  12.  
  13. public class Beast extends SomeZooWeight {
  14. int zero = 0;
  15. int one = 1;
  16. public Beast(int zero, int one){
  17. super(zero,one);
  18. // weight = zero + one * Math.random();
  19.  
  20. }
  21. public void voice() {
  22.  
  23. System.out.println( "Yell" + " " + "My weight is: " + weight + " gramms");
  24. }
  25.  
  26. public void eat() {
  27.  
  28. }
  29.  
  30. public void move() {
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment