




全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
C 控制台模拟学生管理系统 最终运行效果 添加学生 删除学生 修改学生 代码如下 using System using System Collections Generic using System Linq using System Text namespace SGMS class Program static void Main string args List lstStudent new List bool flag true while flag Console WriteLine Console ForegroundColor ConsoleColor Red Console WriteLine 使用提示 按键 操作 A 添加 D 删除 C 修改 L 查看 Console ForegroundColor ConsoleColor Gray Console WriteLine ConsoleKey ck Console ReadKey true Key switch ck case ConsoleKey A Console ForegroundColor ConsoleColor Red Console WriteLine 请输入学生相关信息 Console ForegroundColor ConsoleColor Gray Student stu new Student Console Write 学号 stu stuNo Console ReadLine Trim Console Write 姓名 stu stuName Console ReadLine Trim Console Write 性别 stu stuSex char Parse Console ReadLine Trim Console Write 年龄 stu stuAge short Parse Console ReadLine Trim lstStudent Add stu Console WriteLine 添加成功 break case ConsoleKey D if lstStudent Count 0 Console WriteLine 系统还未添加任何学生信息 else Console Write 请输入要删除的学生的学号 string no Console ReadLine Trim for int i 0 i lstStudent Count i if lstStudent i stuNo no lstStudent Remove lstStudent i Console WriteLine 删除成功 break if i lstStudent Count 1 Console WriteLine 抱歉 系统中没有这个学 号 break case ConsoleKey C if lstStudent Count 0 Console WriteLine 系统还未添加任何学生信息 else Console Write 请输入要修改的学生的学号 string no Console ReadLine Trim for int i 0 i lstStudent Count i Student item lstStudent i if item stuNo no Console Write 学号 item stuNo Console ReadLine Trim Console Write 姓名 item stuName Console ReadLine Trim Console Write 性别 item stuSex char Parse Console ReadLine Trim Console Write 年龄 item stuAge short Parse Console ReadLine Trim lstStudent i item Console WriteLine 修改成功 break if i lstStudent Count 1 Console WriteLine 抱歉 系统中没有这个学 号 break case ConsoleKey L if lstStudent Count 0 Console WriteLine 系统还未添加任何学生信息 else Console WriteLine 学号 t 姓名 t 性别 t 年龄 foreach Student s in lstStudent Console WriteLine 0 t 1 t 2 t 3 s stuNo s stuName s stuSex s stuAge break Main
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025至2031年中国氯气瓶阀行业投资前景及策略咨询研究报告
- 山西体育职业学院《数字信号处理实验》2023-2024学年第二学期期末试卷
- 《探索营养奥秘》课件
- 2025至2031年中国旋转窑垃圾焚烧炉行业投资前景及策略咨询研究报告
- 2025至2031年中国挂墙/窗夹式浴室换气扇行业投资前景及策略咨询研究报告
- 2025至2031年中国壁挂式杀菌空气净化器行业投资前景及策略咨询研究报告
- 2025至2031年中国喷干乌龙茶行业投资前景及策略咨询研究报告
- 《化学工程项目建设流程》课件
- 2025至2030年中国餐饮用调味包数据监测研究报告
- 2025至2030年中国配花材料数据监测研究报告
- 2024年上海嘉定区区属国有企业招聘笔试真题
- 新版人教PEP版三年级下册英语课件 Unit 5 Reading time
- 2024年河南艺术职业学院高职单招语文历年参考题库含答案解析
- 临床护理实践指南2024版
- 生猪屠宰兽医卫生检验人员理论考试题及答案
- 初一新生军训的培训方案
- 油田气站及注水设备维护检修规程及施工工序
- 半钢子午胎培训
- 消防中控考试题初级消防中控考试题题目(一)
- 数据结构课程设计马的遍历
- 政府会计制度讲解PPT课件
评论
0/150
提交评论