Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public abstract class Animal
- {
- private int weigth;
- public int Weigth { get; set; }
- public Animal(string Weigth)
- {
- this.Weigth = Weigth;
- }
- String says()
- {
- return Sound;
- }
- }
- public class Cow : Animal
- {
- public Cow(String Weigth)
- {
- this.Weigth = Weigth;
- }
- String says()
- {
- return Sound = "Mooo";
- }
- }
- public class Snake : Animal
- {
- public Snake(String Weigth)
- {
- this.Weigth = Weigth;
- }
- String says()
- {
- return Sound = "Shhl";
- }
- }
- public class Pig : Animal
- {
- public Pig(String Weigth)
- {
- this.Weigth = Weigth;
- }
- String says()
- {
- return Sound = "Oink";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement