using System;
namespace lesson3_member method exercises
{
#region Exercise 1
// Exercises based on member variables
// Define methods for talking, walking, eating, etc. for humans
class Person
{
public string name;
public int age;
public void Speak(string str)
{
Console.WriteLine("{0}-year-old {1} said {2}", age, name, str);
}
public void Walk()
{
Console.WriteLine("{0}-year-old {1} can walk", age, name);
}
public void Eat()
{
Console.WriteLine("{0}-year-old {1} can eat", age, name);
}
}
#endregion
#region Exercise 2
// Exercises based on member variables
//Define learning, eating and other methods for the student class
class Student
{
public string name;
public int age;
public void Study()
{
Console.WriteLine("{0}-year-old {1} is studying", age, name);
}
public void Eat()
{
Console.WriteLine("{0}-year-old {1} is eating", age, name);
}
}
#endregion
#region Exercise 3
//Define a food category with characteristics such as name and heat
//Think about how to connect with humans and students
class Food
{
public string name;
public float hot;
}
#endregion
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Member method exercises");
}
}
}