当前位置:网站首页>C XX management system
C XX management system
2022-06-26 05:28:00 【Elliot_ Alderson】
Boy, don't be silly , Don't go to the so-called program writing group to find help
- If you don't believe that the final assignment can be copied and pasted directly from me , You can close it .
- It's the kind of writing that sucks XX Management system . There are still people who will pay for , And then I made a lot of money .
I wonder if your money ever flowed into my pocket , However, the service tenet is not refundable .
The following is a recent one written by a teacher C# edition , If you think it's good, give it a compliment .
using System;
using System.Collections.Generic;
class Singleton<T> where T : new()
{
private static T instance;
public static T Instance
{
get
{
if (instance == null)
{
instance = new T();
}
return instance;
}
}
}
class AccountChache
{
public string ID, Name;
public override string ToString()
{
return "ID:" + ID + "\nName" + Name;
}
}/// <summary>
/// Students
/// </summary>
class Controled : AccountChache
{
/// <summary>
/// The results of three courses
/// </summary>
public double Chinese, English, Math;
/// <summary>
/// A simple input function , Let input image Python It's as simple as inside
/// </summary>
/// <param name="msg"></param>
/// <returns></returns>
public string Input(string msg)
{
Console.WriteLine(msg);
return Console.ReadLine();
}
/// <summary>
/// Initialization function , By default, the grades of the three courses are 0
/// </summary>
/// <param name="id"></param>
/// <param name="name"></param>
/// <param name="c"></param>
/// <param name="e"></param>
/// <param name="m"></param>
public Controled(string id, string name, double c = 0, double e = 0, double m = 0)
{
ID = id;
Name = name;
Chinese = c;
English = e;
Math = m;
}
/// <summary>
/// Output all grades
/// </summary>
public void ShowAllGrades()
{
Console.WriteLine(" The grade of Chinese is :", Chinese);
Console.WriteLine(" What's the math score :", Math);
Console.WriteLine(" The English score is :", English);
}
/// <summary>
/// Output all the details of the students
/// </summary>
public void ShowDetails()
{
Console.WriteLine(base.ToString());
ShowAllGrades();
}
/// <summary>
/// Revise grades
/// </summary>
public void SetAllGrades()
{
double c, e, m;
c = Convert.ToInt32(" Please input Chinese score ");
e = Convert.ToInt32(" Please enter your English score ");
m = Convert.ToInt32(" Please enter the math score ");
Chinese = c;
Math = m;
English = e;
Console.WriteLine(" Modification successful , The revised results are as follows ");
ShowAllGrades();
}
}
/// <summary>
/// Class
/// </summary>
class ControledManager
{
Dictionary<int, Controled> ControledList = new Dictionary<int, Controled>();
static int Count = 0;
public string IDCode;
public override string ToString()
{
return " There are students in this class " + Count.ToString() + " people " +" The shift number of this shift is :" + IDCode;
}
public ControledManager()
{
IDCode = Input(" Please enter the shift number ");
}
public string Input(string msg)
{
Console.WriteLine(msg);
return Console.ReadLine();
}
/// <summary>
/// Add student
/// </summary>
public void AddControledMember()
{
string id, name;
id = Input(" Please enter the student number ");
name = Input(" Please enter a name ");
Controled controled = new Controled(id, name);
ControledList.Add(++Count, controled);
Console.WriteLine(" Add success ");
}
/// <summary>
/// Delete students
/// </summary>
public void RemoveControledMember()
{
int Find_id;
Find_id = Convert.ToInt32(Input(" Please input the students ID"));
if (ControledList.ContainsKey(Find_id))
{
Console.WriteLine(ControledList[Find_id].ToString());
string sure = Input(" Are you sure you want to delete ?(y/n)");
if (sure == "y" || sure == "Y")
{
ControledList.Remove(Find_id);
Count--;
Console.WriteLine(" Delete successful ");
}
}
else
{
Console.WriteLine(" Check no one ");
}
}
/// <summary>
/// Revise student grades
/// </summary>
public void ModifyControledMemberGrades()
{
int Find_id;
Find_id = Convert.ToInt32(Input(" Please input the students ID"));
if (ControledList.ContainsKey(Find_id))
{
Console.WriteLine(ControledList[Find_id].ToString());
ControledList[Find_id].SetAllGrades();
}
else
{
Console.WriteLine(" Check no one ");
}
}
/// <summary>
/// Find students
/// </summary>
public void SearchControledMember()
{
int Find_id;
Find_id = Convert.ToInt32(Input(" Please input the students ID"));
if (ControledList.ContainsKey(Find_id))
{
ControledList[Find_id].ShowDetails();
}
else
{
Console.WriteLine(" Check no one ");
}
}
}
/// <summary>
/// The teacher class
/// </summary>
class Controler : Singleton<Controler>
{
/// <summary>
/// The title
/// </summary>
public string Position;
public string name;
Dictionary<int, ControledManager> ControlerManagerList = new Dictionary<int, ControledManager>();
static int Count = 0;
public string Input(string msg)
{
Console.WriteLine(msg);
return Console.ReadLine();
}
public Controler()
{
Position = Input(" Please enter position ");
name = Input(" Please enter a name ");
}
public void AddClass()
{
ControledManager controledManager = new ControledManager();
ControlerManagerList.Add(++Count, controledManager);
Console.WriteLine(" Add success ");
Console.ReadLine();
}
public void RemoveClass()
{
int Find_id = Convert.ToInt32(Input(" Please enter class id"));
if (ControlerManagerList.ContainsKey(Find_id))
{
string sure = Input(" Delete this class ?");
if (sure.ToUpper() == "Y")
{
ControlerManagerList.Remove(Find_id);
Console.WriteLine(" Delete successful ");
}
}
else
{
Console.WriteLine(" There is no such shift ");
}
Console.ReadLine();
}
public void ModifyClass()
{
Console.Clear();
int Find_id = Convert.ToInt32(Input(" Please enter class id"));
if (ControlerManagerList.ContainsKey(Find_id))
{
Console.WriteLine("1、 Add students ");
Console.WriteLine("2、 Delete students ");
Console.WriteLine("3、 Revise student grades ");
Console.WriteLine("4、 Find students ");
int i = Convert.ToInt32(Input(" Please input the operation you want to do :"));
switch (i)
{
case 1:
ControlerManagerList[Find_id].AddControledMember();
break;
case 2:
ControlerManagerList[Find_id].RemoveControledMember();
break;
case 3:
ControlerManagerList[Find_id].ModifyControledMemberGrades();
break;
case 4:
ControlerManagerList[Find_id].SearchControledMember();
break;
}
}
else
{
Console.WriteLine(" There is no such shift ");
}
Console.ReadLine();
Console.Clear();
}
public void SearchClass()
{
int Find_id = Convert.ToInt32(Input(" Please enter class id"));
if (ControlerManagerList.ContainsKey(Find_id))
{
Console.WriteLine(ControlerManagerList[Find_id].ToString());
}
else
{
Console.WriteLine(" Check that there is no class ");
}
Console.ReadLine();
}
}
public static class main
{
public static void Main()
{
Controler controler = new Controler();
while(true)
{
Console.Clear();
Console.WriteLine(" Student information management system ");
Console.WriteLine("1、 Add class ");
Console.WriteLine("2、 Delete class ");
Console.WriteLine("3、 Change the class ");
Console.WriteLine("4、 Find the class ");
Console.WriteLine(" Please enter the operation you need ");
int i = Convert.ToInt32(Console.ReadLine());
switch(i)
{
case 1:
Console.Clear();
controler.AddClass();
Console.Clear();
break;
case 2:
Console.Clear();
controler.RemoveClass();
Console.Clear();
break;
case 3:
Console.Clear();
controler.ModifyClass();
Console.Clear();
break;
case 4:
Console.Clear();
controler.SearchClass();
Console.Clear();
break;
}
}
}
}
this is it OvO
边栏推荐
猜你喜欢
PHP 2D / multidimensional arrays are sorted in ascending and descending order according to the specified key values
There are applications related to web network request API in MATLAB (under update)
Decipher the AI black technology behind sports: figure skating action recognition, multi-mode video classification and wonderful clip editing
apktool 工具使用文档
redis探索之布隆过滤器
《财富自由之路》读书之一点体会
Installation and deployment of alluxio
C# 40. Byte[] to hexadecimal string
[arm] build boa based embedded web server on nuc977
Recursively traverse directory structure and tree presentation
随机推荐
cartographer_ backend_ constraint
[red team] what preparations should be made to join the red team?
Why does the mobile IM based on TCP still need to keep the heartbeat alive?
小小面试题之GET和POST的区别
Red team scoring method statistics
Thoughts triggered by the fact that app applications are installed on mobile phones and do not display icons
出色的学习能力,才是你唯一可持续的竞争优势
Redis installation on Linux
Ribbon负载均衡服务调用
Installation and deployment of alluxio
11 IO frame
瀚高数据库自定义操作符‘!~~‘
Experience of reading the road to wealth and freedom
【ARM】在NUC977上搭建基于boa的嵌入式web服务器
线程优先级
Two step processing of string regular matching to get JSON list
Windows下安装Tp6.0框架,图文。Thinkphp6.0安装教程
BOM文档
Fedora alicloud source
Redis discovery bloom filter