using System;
namespace Cat2
{
///
/// Summary description for Class1.
///
class Class1
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
Cat2 c = new Cat2("Fluffy", 22);
c.setFree();
Cat2 d = new Cat2("George", 1);
d.setFree();
}
}
public class Cat2
{
string name;
int age;
public Cat2()
{
}
public Cat2(string inName, int inAge)
{
name = inName;
age = inAge;
Console.WriteLine("Creating cat " + name + " who is " + age + " months old.");
}
public void setFree()
{
int timeLeft = 50 - age;
Console.WriteLine(name + " is " + age + " months old and has " + timeLeft + " months left to serve.");
}
}
}