Advertisement
Yo_Mb

Yo_21Mb

Oct 13th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. using System;
  2.  
  3. public abstract class Animal
  4. {
  5. private int weigth;
  6. public int Weigth { get; set; }
  7. public Animal(string Weigth)
  8. {
  9. this.Weigth = Weigth;
  10. }
  11. String says()
  12. {
  13. return Sound;
  14. }
  15. }
  16. public class Cow : Animal
  17. {
  18. public Cow(String Weigth)
  19. {
  20. this.Weigth = Weigth;
  21. }
  22. String says()
  23. {
  24. return Sound = "Mooo";
  25. }
  26. }
  27. public class Snake : Animal
  28. {
  29. public Snake(String Weigth)
  30. {
  31. this.Weigth = Weigth;
  32. }
  33. String says()
  34. {
  35. return Sound = "Shhl";
  36. }
  37. }
  38. public class Pig : Animal
  39. {
  40. public Pig(String Weigth)
  41. {
  42. this.Weigth = Weigth;
  43. }
  44. String says()
  45. {
  46. return Sound = "Oink";
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement