C#模拟员工年终奖金评定
程序员文章站
2022-03-08 13:25:33
using System;using System.Collections.Generic;using System.Text;namespace KnowledgePoint{ class _11_Ex_Construction { static void Main(string[] args) { double salary = 5000; string name = "WanAkiko";...
using System;
using System.Collections.Generic;
using System.Text;
namespace KnowledgePoint
{
class _11_Ex_Construction
{
static void Main(string[] args)
{
double salary = 5000;
string name = "WanAkiko";
Console.Write("员工{0}的原工资为{1},请您对其进行年终评定:", name, salary);
String saLevel = Console.ReadLine();
switch (saLevel)
{
case "A":
Console.WriteLine("\n提示:您给员工{0}的年终评定为{1}!", name, saLevel);
Console.WriteLine("综上," + saLevel + "等级员工对应奖金为500,其最终工资为" + (salary + 500) + "元!");
break;
case "B":
Console.WriteLine("\n提示:您给员工{0}的年终评定为{1}!", name, saLevel);
Console.WriteLine("综上," + saLevel + "等级员工对应奖金为200,其最终工资为" + (salary + 200) + "元!");
break;
case "C":
Console.WriteLine("\n提示:您给员工{0}的年终评定为{1}!", name, saLevel);
Console.WriteLine("综上," + saLevel + "等级员工对应奖金为0,其最终工资为" + salary + "元!");
break;
case "D":
Console.WriteLine("\n提示:您给员工{0}的年终评定为{1}!", name, saLevel);
Console.WriteLine("综上," + saLevel + "等级员工对应罚金为200,其最终工资为" + (salary - 200) + "元!");
break;
default:
Console.WriteLine("\n提示:您给员工{0}的年终评定为{1}!", name, saLevel);
Console.WriteLine("综上," + saLevel + "等级员工对应罚金为500,其最终工资为" + (salary - 500) + "元!");
break;
}
Console.ReadKey();
}
}
}
本文地址:https://blog.csdn.net/qq_44965393/article/details/107295744
推荐阅读