⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 employee.cs

📁 this is a good book for the visual c#
💻 CS
字号:
// Fig. 10.9: Employee.cs
// Abstract base class for company employees.
using System;

namespace Employees
{
   public abstract class Employee
   {
      private string firstName;
      private string lastName; 

      // constructor
      public Employee( string firstNameValue, 
         string lastNameValue )
      {
         FirstName = firstNameValue;
         LastName = lastNameValue;
      }

      // property FirstName
      public string FirstName
      {
         get
         {
            return firstName;
         }

         set
         {
            firstName = value;
         }
      }

      // property LastName
      public string LastName
      {
         get
         {
            return lastName;
         }

         set
         {
            lastName = value;
         }
      }

      // return string representation of Employee
      public override string ToString()
      {
         return FirstName + " " + LastName;
      }

      // abstract method that must be implemented for each derived
      // class of Employee to calculate specific earnings
      public abstract decimal Earnings();

   } // end class Employee
}

⌨️ 快捷键说明

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