Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions task1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using System;

class Cat
{
private int age;
private string name;
private string breed;

public Cat()
{
this.age = 0;
this.name = "unknown";
this.breed = "unknown";
}

public Cat(int age, string name, string breed)
{
this.age = age;
this.name = name;
this.breed = breed;
}

public int GetAge()
{
return this.age;
}

public void SetAge(int age)
{
this.age = age;
}

public string GetName()
{
return this.name;
}

public void SetName(string name)
{
this.name = name;
}

public string GetBreed()
{
return this.breed;
}

public void SetBreed(string breed)
{
this.breed = breed;
}

public void Purr()
{
Console.WriteLine("Purrrrrrrrrrr...");
}

public void meow()
{
Console.WriteLine("Meow!");
}
}

class Program
{
public static void Main(string[] args)
{
Cat myCat = new Cat(3, "Whiskers", "Siamese");
Console.WriteLine("My cat's name is " + myCat.GetName());
myCat.meow();
myCat.Purr();
}
}