一个小型辅导班年利润-水压力计算公式
2022年11月15日发(作者:茉莉花茶产地)//ProgramName:StudentInformationManagementSystem
//ProgramPurpo:This is a student information management system which can input、arch and alter the student information .
//Programmer:焦向宁、陈炳仁、潘倩、于睿
using System;
using c;
using entModel;
using ;
using ;
using ;
namespace StdInfManSys
{
class Program
{
public static void Main(string[] args)
{
string a = "" + e + "" + e + "" + e + "" + e + "";
ine(a); //空行
oundColor = ; //字体颜色
ine("t#~~~~~~~~~~~~~~~~~~~***************~~~~~~~~~~~~~~~~~~~~~~#");
ine("t# #");
ine("t# #");
ine("t# 学生信息管理系统 #");
ine("t# #");
ine("t# #");
ine("t# 制作者:焦向宁、陈柄任、潘倩、于睿 #");
ine("t#~~~~~~~~~~~~~~~~~~~***************~~~~~~~~~~~~~~~~~~~~~~#");
//表头
oundColor = ;
("ttt请按Enter键进入系统操作界面"); //按ENTER键进入操作界面
string strPwd = ne();
bool blLogin = (strPwd == "");
string strInfo = blLogin ? "t*****************欢迎进入学生信息管理系统*****************" : "输入错误";
ine(strInfo);
ine("请选择操作选项(1-录入信息、2-查询信息、3-修改信息、4-删除信息、0-退出程序):");
/***
操作主菜单
***/
int Operate1; //用户用来选择的操作
Operate1 = 32(ne());
while (Operate1 != 0)
{
switch (Operate1)
{
/****************************************录入学生信息****************************************/
//在TXT文档中输入学生信息
ca 1:
{
ine("请输入学生个数:");
int Number = 32(ne());
int Counter ;
for (Counter = 0; Counter < Number; Counter++)
{
ine("请依次输入学生姓名、学号、性别、年龄、专业和爱好:");
string path = @"D:"; //在D盘上创建TXT文档:SIMS
Student std = new Student(); //定义对象std,并将其信息输入到SIMS文件中
string appenAllText = + " " + + " " + + " " + + " " + + " " + t + e;
AllText(path, appenAllText);
}
}
break;
/****************************************查询学生信息****************************************/
ca 2:
ine("请选择查询方式(5-按姓名查询、6-按学号查询、7-按性别查询、8-按年龄查询、9-按专业查询、10-按爱好查询、11-全部显示):");
int Operate2; //用户用来选择的操作
Operate2 = 32(ne());
switch (Operate2)
{
ca 5: //按学生姓名查询
ine("请输入所要查询的学生的姓名:");
string Line;
StreamReader sr = new StreamReader("D:");
string NAME = ne();
while ((Line = ne()) != null)
{
if (ns(NAME))
ine(Line);
}
();
e();
break;
ca 6: //按学生学号查询
ine("请输入所要查询的学生学号:");
string Line1;
StreamReader sr1 = new StreamReader("D:SI
");
string NUMBER = ne();
while ((Line1 = ne()) != null)
{
if (ns(NUMBER))
ine(Line1);
}
();
e();
break;
ca 7: //按学生性别查询
ine("请输入所要查询的学生性别:");
string Line2;
StreamReader sr2 = new StreamReader("D:");
string SEX = ne();
while ((Line2 = ne()) != null)
{
if (ns(SEX))
ine(Line2);
}
();
e();
break;
ca 8: //按学生年龄查询
ine("请输入所要查询的学生的年龄:");
string Line3;
StreamReader sr3 = new StreamReader("D:");
string AGE = ne();
while ((Line3 = ne()) != null)
{
if (ns(AGE))
ine(Line3);
}
();
e();
break;
ca 9: //按学生专业查询
ine("请输入所要查询的学生的专业:");
string Line4;
StreamReader sr4 = new StreamReader("D:");
string MAJOR = ne();
while ((Line4 = ne()) != null)
{
if (ns(MAJOR))
ine(Line4);
}
();
e();
break;
ca 10: //按学生兴趣查询
ine("请输入所要查询的学生的爱好:");
string Line5;
StreamReader sr5 = new StreamReader("D:");
string INTREST = ne();
while ((Line5 = ne()) != null)
{
if (ns(INTREST))
ine(Line5);
}
();
e();
break;
ca 11: // 显示文件的全部内容
StreamReader reader = new StreamReader("D:");
string all = End();
ine(all);
();
e();
break;
default:
ine("{0}
{1}", "错误!", "请重新输入!");
break;
}
break;
/***************************************修改学生信息****************************************/
ca 3:
ine("请输入您要修改的某行中包含的一条信息:");
string WrongLine = ne();
int LinNum = 0;
int LN = LinNum ;
StreamReader SR = new StreamReader("D:");
string LINE ;
while ((LINE = ne()) != null)
{
if (ns(WrongLine))
{
LN = LinNum;
}
el
LinNum = LinNum + 1;
}
();
e();
List lines = new List(lLines("D:"));
At(LN);
llLines("D:", lines
.ToArray());
ine("请重新输入该学生的基本信息(依次输入姓名、学号、性别、年龄、专业和爱好):");
string path1 = @"D:" ;
Student std1 = new Student();
string appenAllText1 = + " " + + " " + + " " + + " " + + " " + t + e;
AllText(path1, appenAllText1);
//string readText1 = lText(path1);
break;
/***************************************删除学生信息****************************************/
ca 4:
{
ine("请选择删除选项:12-删除一行文件、13-清空TXT文档中的全部信息、14-删除TXT文档:");
{
int m;
m = 32(ne());
switch (m)
{
ca 12:
ine("请输入您要删除的某行含有的一条信息:");
string DelLine = ne();
int LineNumber = 0;
int ln = LineNumber ;
StreamReader SR1 = new StreamReader("D:");
string LINE1 ;
while ((LINE1 = ne()) != null)
{
if (ns(DelLine))
{
ln = LineNumber;
}
el
LineNumber = LineNumber + 1;
}
();
e();
List Lines = new List(lLines("D:"));
At(ln);
llLines("D:", y());
ine("删除成功!");
break;
ca 13: //清空TXT文档
FileStream fs = new FileStream(@"D:", , );//清空TXT文档中的信息,打开一个写入流,然后立即关闭它
();
ine("删除成功!");
break;
ca 14: //删除TXT文档
("D:");
ine("删除成功!");
break;
}
}
break;
}
default: ine("{0}
{1}", "错误!", "请重新输入!");
break;
}
ine("请选择操作选项(1-录入信息、2-查询信息、3-修改信息、4-删除信息、0-退出程序):");
Operate1 = 32(ne());
}
}
}
class Student //创建类:学生
{
//定义学生的6个基本信息
public
string Name = ne();
public
string StdId = ne();
public
string Sex = ne();
public
string Age = ne();
public
string Major = ne();
public
string Intrest = ne();
};
};