1 Star 0 Fork 50

陌./C_sharp面向对象笔记

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Class1.cs 1.54 KB
一键复制 编辑 原始数据 按行查看 历史
刘涛 提交于 2022-04-25 17:29 +08:00 . 笔记
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApp1
{
class gy
{
// 雇员系统,定义雇员基类,共同的属性,姓名、地址和出生日期(可有可无),
//子类:程序员,秘书,高层管理,清洁工,
//他们有不同的工资算法,其中高级主管和程序员采用底薪加提成(6000)的方式,
//高级主管和程序员的底薪分别是5000元和2000元?,秘书和清洁工采用工资的方式,
//工资分别是3000和1000,(以多态的方式处理程序。)
public string name { get; set; }
public string dz { get; set; }
public decimal dixin { get; set; }
public virtual decimal salay() {
return dixin;
}
}
class cxy : gy {
public decimal tc = 6000;
public new decimal dixin = 2000;
public override decimal salay()
{
return dixin + tc;
}
}
class gl : gy {
public decimal tc = 6000;
public new decimal dixin = 5000;
public override decimal salay()
{
return dixin + tc;
}
}
class ms : gy {
public decimal dixin = 3000;
public override decimal salay()
{
return dixin;
}
}
class qjg : gy {
public decimal dixin = 1000;
public override decimal salay()
{
return dixin;
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chen-li-xing/c-sharp-object-oriented-notes.git
git@gitee.com:chen-li-xing/c-sharp-object-oriented-notes.git
chen-li-xing
c-sharp-object-oriented-notes
C_sharp面向对象笔记
master

搜索帮助