public Person Person1 = new Person();
public Person Person2 = new Person();
public Person Person3 = new Person();
Console.WriteLine("Hello, world.");
Console.WriteLine(Person1.Name + "年紀為 " + Person1.Age);
Console.WriteLine(Person2.Name + "年紀為 " + Person2.Age);
Console.WriteLine(Person3.Name + "年紀為 " + Person3.Age);
Console.WriteLine(Person1.Name + "BMI為" + Person1.BMI());
Console.WriteLine(Person2.Name + "BMI為" + Person2.BMI());
Person2.Walk("後","倒車音效");
Person1.BMI1(Person1.Name,Person1.Weight,Person1.Height);
public const int Legs = 2;
public const int Hands = 2;
public float Height = 168;
public float Weight = 58.5f;
public bool Adult = true;
public string Name = "Kid";
Console.WriteLine(Name + ":我的身高為 " + Height);
Console.WriteLine(Name + ":我的體重為 " + Weight);
return Weight / ((Height / 100) * (Height / 100));
public void BMI1(string Name, float Weight, float Height)
Console.WriteLine(Name + "BMI為" + Weight / ((Height / 100) * (Height / 100)));
public void Walk(string direction, string sound = "走路音效")
Console.WriteLine(Name + "往"+ direction + "走");
Console.WriteLine(sound);
public void Walk(string direction, int speed)
Console.WriteLine(Name + "往" + direction + "走,時速為:" + speed);