![]()
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StringTest
{
class Employee
{
private int id;
public int ID
{
get { return id; }
set { id = value; }
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
private string sex;
public string Sex
{
get { return sex; }
set { sex = value; }
}
private int age;
public int Age
{
get { return age; }
set { age = value; }
}
// A:实现新增员工(工号,年龄,姓名,性别)
public Employee(int _id, int _age, string _name, string _sex)
{
this.Name = _name;
this.Age = _age;
this.Sex = _sex;
this.ID = _id;
}
//B:展示员工信息,
public void ShowMsg()
{
Console.WriteLine("工号:{0} 年龄:{1} 姓名:{2} 性别:{3}", this.ID, this.Age, this.Name, this.Sex);
}
}
}
View Code