Untitled
unknown
csharp
2 years ago
2.3 kB
3
Indexable
public class Animal { public string name; public int age; public string skin; public string kraynici; public string type; public string food; string color; int broy_krajnici; public string Color { set { this.color = "Жълто-червено"; } get { return this.color; } } public int Broy_kraynici { set { this.broy_krajnici = value; } get { return this.broy_krajnici; } } } class Program { static void Main(string[] args) { Animal myPet = new Animal(); Console.WriteLine("ИГРА: Познай моят домашен любимец"); myPet.name = "Рори"; myPet.type = "Птица"; myPet.age = 13; myPet.skin = "Пъстроцветна"; myPet.kraynici = "Две крила и два крака"; myPet.food = "Семена и зърнени култури"; myPet.Color = "Жълто-червено"; myPet.Broy_kraynici = 4; Console.WriteLine(""); Console.WriteLine("(Моля напишете отговора с главна буква и на кирилица)"); Console.WriteLine(""); Console.WriteLine("Име: " + myPet.name); Console.WriteLine("Вид: " + myPet.type); Console.WriteLine("Възраст: " + myPet.age); Console.WriteLine("Перушина: " + myPet.skin); Console.WriteLine("Крайници: " + myPet.kraynici); Console.WriteLine("Храна: " + myPet.food); Console.WriteLine("Цвят: " + myPet.Color); Console.WriteLine("Брой крайници: " + myPet.Broy_kraynici); Console.WriteLine(""); string answear = Console.ReadLine(); if (answear == "Папагал") { Console.WriteLine("Ти позна! Отговорът е папагал."); } else { Console.WriteLine("Опитай пак"); } } }
Editor is loading...