已阅读5页,还剩30页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
通用学生信息管理系统-C#结业报告院系:计算机科学与工程班级:140402姓名:周琳学号:20141180一、问题提出:1.创建相应的成员变量保存学生基本信息。2.创建相应属性和索引以实现对成员变量访问的封装。3.创建相应的方法以实现对学生基本信息的管理。 4.创建相应的方法以实现对学生成绩的管理。5.派生出小学生,中学生,大学生等子类。二、问题分析: 1、添加基类Student,定义私有成员变量姓名,性别,号,民族,住址,英语,数学,语文等学生的基本信息并创建相应的属性实现对成员变量访问的封装。 2、分别定义派生类Pupil,CollegeStudenr,Middleschoolstudent,并使用base关键字调用基类构造函数。 3、添加Option类实现对学生信息进行的一系列操作。 4、添加Manager类实现管理用户登陆。三、程序代码:Student.cs:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace StudentInformation public class Student private string studentType; public string StudentType getreturn studentType; setstudentType=value; private string studentName; public string StudentName get return studentName; set studentName = value; private string studentSex; public string StudentSex get return studentSex; set studentSex = value; private string studentNumber; public string StudentNumber get return studentNumber; set studentNumber = value; private string studentNation; public string StudentNation get return studentNation; set studentNation = value; private string studentAddress; public string StudentAddress get return studentAddress; set studentAddress = value; private string englishScore; public string EnglishScore get return englishScore; set englishScore = value; private string mathScore; public string MathScore get return mathScore; set mathScore = value; private string chineseScore; public string ChineseScore get return chineseScore; set chineseScore = value; public Student(string type,string name,string sex,string number,string nation,string address,string english,string math,string chinese) this.studentType=type; this.studentName=name; this.studentSex=sex; this.studentNumber=number; this.studentNation=nation; this.studentAddress=address; this.englishScore=english; this.mathScore=math; this.chineseScore=chinese; public void showstudent() Console.WriteLine(该同学的基本信息为:); Console.WriteLine(学生类型:+studentType); Console.WriteLine(姓名:+studentName); Console.WriteLine(性别:+studentSex); Console.WriteLine(学号:+studentNumber); Console.WriteLine(住址:+studentAddress); Console.WriteLine(英语:+englishScore); Console.WriteLine(数学:+mathScore); Console.WriteLine(语文:+chineseScore); Option.cs:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace StudentInformation public class Option : Student int flag; public Option(string Type, string Name, string Sex, string Number, string Nation, string Address, string English, string Math, string Chinese) : base(Type, Name, Sex, Number, Nation, Address, English, Math, Chinese) Console.WriteLine(对学生信息进行相关的操作); public void input() Console.WriteLine(请输入一系列的相关信息); StudentName = Console.ReadLine(); StudentSex = Console.ReadLine(); StudentNumber = Console.ReadLine(); StudentNation = Console.ReadLine(); StudentAddress = Console.ReadLine(); EnglishScore = Console.ReadLine(); MathScore = Console.ReadLine(); ChineseScore = Console.ReadLine(); public void search_number(string numm) flag = 0; if (StudentNumber = numm) Console.WriteLine(StudentNumber + 被找到); flag = 1; public void search_name(string nname) flag = 0; if (StudentName = nname) Console.WriteLine(StudentName + 被找到); flag = 1; public void input_englishScore() Console.WriteLine(请重新输入英语成绩); string englishScore = Console.ReadLine(); this.EnglishScore = englishScore; public void input_chineseScore() Console.WriteLine(请重新输入语文成绩); string chineseScore = Console.ReadLine(); this.ChineseScore = chineseScore; public void input_mathScore() Console.WriteLine(请重新输入数学成绩); string mathScore = Console.ReadLine(); this.MathScore = mathScore; public int getflag() return flag; Middleschoolstudent.cs:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace StudentInformation public class Middleschoolstudent:Option public Middleschoolstudent(string Type, string Name, string Sex, string Number, string Nation, string Address, string English, string Math, string Chinese) : base(Type, Name, Sex, Number, Nation, Address, English, Math, Chinese) StudentType = 中学生; Program.cs:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace StudentInformation class Program int number, judge = 0, flag, choose = 0; static void Main(string args) int i, j, n = 0, t = 0, k = 0; string find_name, find_number, delet_number, judgestring; Console.WriteLine(*欢迎使用通用学生管理系统*); Console.WriteLine(请输入用户名:); string username = Console.ReadLine(); manager ma = new manager(); ma.Next = username; if (ma.load() Console.WriteLine( * ); Console.WriteLine( 通用学生信息管理系统 ); Console.WriteLine( * ); Console.WriteLine( 1.录入基本信息 ); Console.WriteLine( 2.删除信息 ); Console.WriteLine( 3.修改基本信息 ); Console.WriteLine( 4.查询基本信息 ); Console.WriteLine( 5.打印信息 ); Console.WriteLine( * ); Console.WriteLine( 欢迎使用 ); Console.WriteLine( * ); Console.WriteLine(n); Console.WriteLine(请选择学生类型:); Console.WriteLine(1.大学生); Console.WriteLine(2.中学生); Console.WriteLine(3.小学生); CollegeStudent g = new CollegeStudent100; Middleschoolstudent m = new Middleschoolstudent100; Pupil s = new Pupil100; int choose = int.Parse(Console.ReadLine(); switch (choose) case 1: do Console.WriteLine(请输入你要选择执行的功能:); int number1 = int.Parse(Console.ReadLine(); int judge = 0; switch (number1) case 1: i = 0; do gi = new CollegeStudent(0, 0, 0, 0, 0, 0, 0, 0, 0); gi.input(); i+; n+; Console.WriteLine( 是否继续录入档案?是1.否2.); judge = int.Parse(Console.ReadLine(); while (judge = 1); Console.WriteLine(共录入 + n + 人); break; /录入 case 2: do t = 0; judge = 0; Console.WriteLine(请输入您要删除的学号); delet_number = Console.ReadLine(); for (i = 0; i n ;i+) gi.search_number(delet_number); if (gi.getflag() = 1) for (j = i; j n; j+) gj = gj + 1; n-; t+; Console.WriteLine(正在删除); Console.WriteLine(删除成功); if (t = 0) Console.WriteLine(您删除的学生的学生学号不存在); Console.WriteLine(是否继续删除 是1否2); judge = int.Parse(Console.ReadLine(); while (judge = 1); break; /删除 case 3: Console.WriteLine( * ); Console.WriteLine( 通用学生信息管理系统修改 ); Console.WriteLine( * ); Console.WriteLine( 1.英语 ); Console.WriteLine( 2.数学 ); Console.WriteLine( 3.语文 ); do Console.WriteLine(请输入你要选择执行的功能:); int number2 = int.Parse(Console.ReadLine(); switch (number2) case 1: do t = 0; judge = 0; Console.WriteLine(请输入你要修改的英语成绩的学生的学号:); find_number = Console.ReadLine(); for (i = 0; i n; i+) gi.search_number(find_number); if (gi.getflag() = 1) gi.input_englishScore(); t+; if (t = 0) Console.WriteLine(您查找的人不在); Console.WriteLine( 是否继续录入档案?是1.否2.); judge = int.Parse(Console.ReadLine(); while (judge = 1); break; case 2: do t = 0; judge = 0; Console.WriteLine(请输入你要修改的数学成绩的学生的学号:); find_number = Console.ReadLine(); for (i = 0; i n; i+) gi.search_number(find_number); if (gi.getflag() = 1) gi.input_mathScore(); t+; if (t = 0) Console.WriteLine(您查找的人不在); Console.WriteLine( 是否继续档案?是1.否2.);
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 安全技能培训管理规范
- 麒麟操作系统教程(微课版)-教学大纲
- 雷电天气室内外安全防护要点
- (正式版)T∕CCASC 0057.2-2025 离子膜法烧碱生产安全操作规程 第2部分:电解
- 2026重庆合川区妇幼保健院公开招聘笔试备考试题及答案解析
- 2026年西藏自治区那曲市城管协管招聘笔试参考题库及答案解析
- 金属非金属矿山安全管理奖罚制度
- 2026内蒙古呼伦贝尔市林草执法人员招聘35人考试模拟试题及答案解析
- 2026年度江汉大学附属医院公开招聘3人笔试备考试题及答案解析
- 2026新疆恒海国有资产经营有限公司招聘3人考试备考题库及答案解析
- 2026年北京市海淀区初三下学期一模语文试卷及答案
- (二模)2026年广州市普通高中高三毕业班综合测试(二)物理试卷(含答案及解析)
- 哈三中2025-2026学年度下学期高二学年4月月考 英语(含答案)
- XX 智能科技有限公司估值报告
- 2025年长沙市芙蓉区事业单位真题
- 2026年个人履职尽责对照检查及整改措施
- 2026年上海市浦东新区高三下学期二模政治试卷和答案
- 《生态环境法典》与排污许可深度解读
- 学堂在线面向未来社会的服务设计与管理章节测试答案
- 沈局工作制度
- 【新教材】人教版(2024)八年级下册英语Unit 5 Nature's Temper单元教学设计
评论
0/150
提交评论