版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、package 学生成绩管理系统;import java.util.*;public class StudentMarkManagepublic static int Max=50;public static String student_ID=new StringMax;public static String name=new StringMax;public static String sex=new StringMax;public static double mark=new doubleMax;public static int cout=0;/ 学生的人数public stati
2、c String stuID;/public static int i=0;public static double modifymark=0;public static int select_number=0;private static boolean p;public static void AddStudent() Scanner read=new Scanner(System.in);if(cout>=Max) System.out.println(" 数组已满 ,不能增加人数 ");return;t:while(true)System.out.print(
3、" 请输入学生的学号:");try student_IDcout=read.nextLine();break;catch(Exception e)System.out.println(" 你输入的学号有误,程序将返回功能菜单");continue t; System.out.print(" 请输入学生名字:");try namecout=read.nextLine();catch(Exception e) System.out.print(" 请输入学生性别 :"); try sexcout=read.nextLi
4、ne(); catch(Exception e) System.out.print(" 请输入学生的成绩:");try markcout=Double.parseDouble(read.nextLine(); catch(Exception e) System.out.println(" 输入错误 ,新增失败,程序将返回功能菜单");return; public static void ModifyMark() int i;Scanner read=new Scanner(System.in); t:while(true) System.out.prin
5、tln(" 请输入学生的学号:");try stuID=read.nextLine(); break; catch(Exception e) System.out.println(" 输入错误 ,程序将返回功能菜单");continue t; for(i=0;i<cout;i+) if(student_IDi.equals(stuID) break; if(i>=cout) System.out.println(" 你输入的学生的学号不存在");return;/退出 switch 语句System.out.print(&q
6、uot; 请输入学生的新成绩:");trymodifymark=Double.parseDouble(read.nextLine();catch(Exception e)System.out.println(" 输入错误 ,程序将返回功能菜单");return;marki=modifymark;public static void DeleteStudent()int i;Scanner read=new Scanner(System.in);t:while(true)System.out.print(" 请输入你要删除的学生的学号:");tr
7、ystuID=read.nextLine();break;catch(Exception e)能");System.out.println(" 你输入的要删除的学生的学号不存在,程序将返回菜单功continue t;for(i=0;i<cout;i+)if(student_IDi.equals(stuID)break;if(i>=cout)System.out.println(" 你输入的学生学号不存在 "); return; for(int j=i;j<cout;j+) student_IDj=student_IDj+1;namej=
8、namej+1;sexj=sexj+1;markj=markj+1;/数组最后一个记录要删除student_IDcout-1=""namecout-1=""sexcout-1=""markcout-1=0;public static void SearchStudent()int i;Scanner read=new Scanner(System.in);t:while(true) System.out.print(" 请输入你要查询的学生的学号:");try stuID=read.nextLine(); brea
9、k;catch(Exception e) System.out.println(" 你输入的学生的学号不存在,程序将返回菜单功能");continue t; for(i=0;i<cout;i+)if(student_IDi.equals(stuID) System.out.println(" 学 号 :"+student_IDi+" 姓 名 :"+namei+" 性 别 :"+sexi+" 成绩 :"+marki);return;if(i>=cout) System.out.prin
10、tln(" 你输入的学生的学号不存在,程序将返回菜单功能");return; public static void PrintMark() int i;if(cout=0)System.out.println("no one student");for(i=0;i<cout;i+)System.out.println(" 学 号 :"+student_IDi+" 名 字 :"+namei+" 性 别 :"+sexi+" 成绩 :"+marki);public stati
11、c void ExitSystem() System.out.println(" 你选择的功能是退出,再见");public static int select_menu() Scanner read=new Scanner(System.in);p:while(true) t:while(true) System.out.println("|*|");学生成绩管理系统System.out.println("|*|"V1.增加学生|);System.out.println("|*2.修改成绩|)|);System.out.p
12、rintln("|*|"V3.删除学生|);System.out.println("|*|"V4.查询成绩|);System.out.println("|*|"V5.打印成绩|);System.out.println("|*6.退出系统System.out.print("请输入你要选择的数字:");tryselect_number=Integer.parseInt(read.nextLine(); break;catch(Exception e)System.out.println(" 输入错误 ");continue t;if(select_number<1|select_number>6)System.out.println(" 你输入的数字有误,请再一次的输入");continue p;break;return select_number;public static void main(String args)t:while(true)switch(selec
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 电子商务平台营销策略优化与效果评估方案
- 超市管理制度1
- 前处理岗位试题及答案
- 公务员体育试题及答案
- 2025年临床执业医师《药理学》模拟练习卷
- 药品短缺监测预警管理培训试题及答案
- 医保住院管理政策培训试题及答案
- 医疗保险服务规范考核试题及答案
- 门窗设计考试题及答案
- 乳腺外科三基三严考试题库及答案
- 《当前保密工作面临的新形势、新任务》课件
- 食品微生物学基础课程标准(一)
- 国家职业技术技能标准 6-11-01-04 制冷工 人社厅发2018145号
- 承插型盘扣式钢管脚手架安全技术标准JGJT231-2021规范解读
- 2025年齐齐哈尔市高三语文3月一模考试卷附答案解析
- 环卫清扫保洁服务方案投标文件(技术方案)
- 生命教育与心理健康教育的融合路径研究
- 新概念英语第一册随堂练习-Lesson127~128(有答案)
- 2024-年全国医学博士外语统一入学考试英语试题
- 车辆运营服务合同模板
- 个人合作开店合同范例
评论
0/150
提交评论