programmer.cs

来自「东软内部材料(四)asp等相关的教学案例 」· CS 代码 · 共 49 行

CS
49
字号
using System;

namespace People
{
  ///<remarks>
  ///The <c>programmer</c>class defines the salient
  ///attributes of every fine programmer.
  ///<seealso cref="Person">Inherits from person</seealso>
  ///</remarks>

  public class Programmer : Person
  {
    private int _avgHoursSleepPerNight;

    ///<summary>Default constructor</summary>
    public Programmer(): base()
    {
    }

    ///<summary>Constructor using first and last names</summary>
    ///<param name="firstName">The first name of the programmer</param>
    ///<param name="lastName">The last name of the programmer</param>
    ///<seealso cref="string"/>
    public Programmer(string firstName, string lastName): base(firstName, lastName)
    {
    }

    ///<summary>Constructor using first and last names and
    ///the hours of sleep</summary>
    ///<param name="firstName">The first name of the programmer</param>
    ///<param name="lastName">The last name of the programmer</param>
    ///<param name="hoursSleep">The average number of hours of sleep</param>
    ///<seealso cref="string"/>
    ///<seealso cref="int"/>
    public Programmer(string firstName, string lastName, int hoursSleep): base(firstName, lastName)
    {
      _avgHoursSleepPerNight = hoursSleep;
    }

    ///<value>Defines the average number of hours of sleep.</value>
    public int AvgHoursSleepPerNight
    {
      get { return _avgHoursSleepPerNight; }
      set { _avgHoursSleepPerNight = value; }
    }
  }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?