using System;
namespace pr_nasledI
{
interface IAnimal
{
void SetAnimal();
void GetAnimal();
}
class Animal : IAnimal
{
private string Name_Animal;
private int Age;
private string Gender;
public Animal()
{
Console.WriteLine("Enter the name and age ");
Name_Animal = Console.ReadLine();
Age = Int32.Parse(Console.ReadLine());
Gender = Console.ReadLine();
}
public void SetAnimal()
{
Console.WriteLine("Enter the name and age and gender\n");
Name_Animal = Console.ReadLine();
Age = Int32.Parse(Console.ReadLine());
Gender = Console.ReadLine();
Console.WriteLine();
}
public void GetAnimal()
{
Console.WriteLine("Name: " + Name_Animal + "\n Age: " + Age + "\n Gender: " + Gender);
}
}
class Bird : Animal
{
private int Size_Wings;
public Bird() : base()
{
Console.WriteLine("Enter the size wings bird ");
Size_Wings = Int32.Parse(Console.ReadLine());
base.GetAnimal();
GetBird();
}
public void SetBird()
{
Console.WriteLine("Enter the size wings bird \n");
Size_Wings = Int32.Parse(Console.ReadLine());
Console.WriteLine();
}
public void GetBird()
{
Console.WriteLine("Size_Wings : " + Size_Wings + "\n");
}
}
class Shark : Animal
{
private int Nuber_of_Births;
public Shark() : base()
{
Console.WriteLine("Enter the nuber of paws mammal ");
Nuber_of_Births = Int32.Parse(Console.ReadLine());
base.GetAnimal();
GetShark();
}
public void SetShark()
{
Console.WriteLine("Enter the nuber of paws mammal \n");
Nuber_of_Births = Int32.Parse(Console.ReadLine());
Console.WriteLine();
}
public void GetShark()
{
Console.WriteLine("Nuber_of_Paws : " + Nuber_of_Births + "\n");
}
}
class Elephont : Animal
{
private string from_country;
public Elephont() : base()
{
Console.WriteLine("Enter the type nasekomogo");
from_country = Console.ReadLine();
base.GetAnimal();
GetElephont();
}
public void SetElephont()
{
Console.WriteLine("Enter the type nasekomogo \n");
from_country = Console.ReadLine();
Console.WriteLine();
}
public void GetElephont()
{
Console.WriteLine("Type nasekomogo : " + from_country + "\n");
}
}
class Dog : Animal
{
private string breed;
public Dog() : base()
{
Console.WriteLine("Enter the type nasekomogo");
breed = Console.ReadLine();
base.GetAnimal();
GetDog();
}
public void SetDog()
{
Console.WriteLine("Enter the type nasekomogo \n");
breed = Console.ReadLine();
Console.WriteLine();
}
public void GetDog()
{
Console.WriteLine("Type nasekomogo : " + breed + "\n");
}
}
class Cat : Animal
{
private string coat_color;
public Cat() : base()
{
Console.WriteLine("Enter the type nasekomogo");
coat_color = Console.ReadLine();
base.GetAnimal();
GetCat();
}
public void SetCat()
{
Console.WriteLine("Enter the type nasekomogo \n");
coat_color = Console.ReadLine();
Console.WriteLine();
}
public void GetCat()
{
Console.WriteLine("Type nasekomogo : " + coat_color + "\n");
}
}
class Aviary
{
}
class Program
{
static void Main(string[] args)
{
IAnimal[] animal = new IAnimal[10];
while (true)
{
Console.WriteLine("What kind of animal do you have? \n " +
"1 - shark, 2 - bird, 3 - cat, 4 - dog, " +
"5 - Elephont \n" + "if you do not have an animal" +
" enter 0");
int type = Int32.Parse(Console.ReadLine());
if (type == 1)
{
animal[0] = new Shark();
animal[1] = new Shark();
Console.WriteLine();
}
else if (type == 2)
{
animal[2] = new Bird();
animal[3] = new Bird();
Console.WriteLine();
}
else if (type == 3)
{
animal[4] = new Cat();
animal[5] = new Cat();
Console.WriteLine();
}
else if (type == 4)
{
animal[6] = new Dog();
animal[7] = new Dog();
Console.WriteLine();
}
else if (type == 5)
{
animal[8] = new Elephont();
animal[9] = new Elephont();
Console.WriteLine();
}
else if (type == 0)
{ break; }
else
{
Console.WriteLine("Invalid number");
}
Console.WriteLine("Do you want to continue?");
string answer = Console.ReadLine();
if (answer == "no") break;
}
}
}
}