版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、精选优质文档-倾情为你奉上学分管理程序学号:_姓名:_鲁文轩_完成日期:2012年5月【题目描述的内容】请设计一个学生的学分管理程序。假设每位学生必须完成基础课50学分、专业课50学分、选修课24学分、人文类课程8学分、实验性课程20学分才能够毕业。因此在管理学分时,要考虑每个学分所属于的课程类别。该程序应该具有下列功能:(1) 录入全部学生的学分信息;(2) 显示全部学生的学分信息; (3) 添加某位学生的学分; (4) 给定学号,显示某位学生的学分完成情况;(5) 给定某个班级的班号,显示该班所有学生学分完成情况; (6) 给定某位学生的学号,修改该学生的学分信息, 要求有修改确认; (7
2、) 给定某位学生的学号,删除该学生的学分信息,要求有删除确认;(8) 提供一些统计各类信息的功能(如按照某类课程的学分高低进行排序、某类课程的平均学分、最高学分、最低学分,能够毕业的学生人数等)。【题目要求】(1) 按照分析、设计、编码、调试和测试的软件开发过程完成这个应用程序;(2) 学分信息应该包括学号、姓名、课程类别、学分等;(3) 为各项操作功能设计一个菜单。应用程序运行后,先显示这个菜单,然后用户通过菜单项选择希望进行的操作项目。【输入要求】应用程序运行后,在屏幕上显示一个菜单。用户可以根据需求,选定相应的操作项目。进入每个操作后(若需要,还可显示子菜单),根据应用程序的提示信息,从
3、键盘输入相应的信息。要求用户输入数据时,要给出清晰、明确的提示信息,包括输入的数据内容、格式及结束方式等。【输出要求】(1) 应用程序运行后,要在屏幕上显示一个菜单;(2) 要求用户输入数据时,要给出清晰、明确的提示信息,包括输入的数据内容、格式及结束方式等。【提示】设计一个结构类型(含学生的学号、姓名、课程类别、学分等)和一个该结构类型的一维数组(存放若干学生的学分信息)。【用户文档的内容】(1) 应用程序功能的详细说明1. 录入全部学生的学分信息。2. 显示全部学生的学分信息。3. 添加某位学生的学分。4. 给定学号,显示某位学生的学分完成情况。5. 给定某个班级的班号,显示该班所有学生学
4、分完成情况。6. 给定某位学生的学号,修改该学生的学分信息, 要求有修改确认。7. 给定某位学生的学号,删除该学生的学分信息,要求有删除确认。8. 显示全部学生能毕业的人数。0. 退出系统。(2) 应用程序运行环境的要求WINDOWS 95/97/98/2000/ XP Vista TurboC+3.0 TurboC2.0 WinTC(3) 应用程序的安装与启动方法 双击c .EXE 或 打开c.c文件后按Ctrl+F9(4) 程序的界面、交互方式和操作方法(5) 输入数据类型、格式和内容限制 char class_number30; char number100; char name100;
5、 int basic_course_credit; int specialized_course_credit; int optional_course_credit; int humanities_courses; int experimental_course;(6)应用程序运行中,用户需要使用的交互命令名称、功能和格式的详细解决和示例进入程序需要密码(111) 输入1 调用int input (CREDIT s,int n)函数输入2 调用void browseall(CREDIT s,int n)函数 输入3 调用int add(CREDIT s,int n)函数 输入4 调用void
6、 browsestudent(CREDIT s,int n)函数 输入5 调用void browseclass(CREDIT s,int n)函数 输入6 调用void amend(CREDIT s,int n)函数 输入7 调用int Delete(CREDIT s,int n)函数输入0 退出【技术文档的内容】(1) 程序整体结构(模块划分)以及各模块功能描述,包括函数的功能、函数名、函数的接口设计,即函数的参数和函数返回值等void displayMenu() 用户界面提示语。int input (CREDIT s,int n) 录入全部学生的学分信息,有返回值。void browsea
7、ll(CREDIT s,int n) 显示全部学生的学分信息,无返回值。int add(CREDIT s,int n) 添加某位学生的学分,有返回值。void browsestudent(CREDIT s,int n) 显示某位学生的学分完成情况,无返回值。void browseclass(CREDIT s,int n) 显示该班所有学生学分完成情况,无返回值。void amend(CREDIT s,int n) 给定某位学生的学号,修改该学生的学分信息,无返回值。int Delete(CREDIT s,int n) 给定某位学生的学号,删除该学生的学分信息,有返回值。void graduat
8、ion(CREDIT s,int n) 显示全部学生能毕业的人数。(2) 各模块的主要算法(用流程图描述)和数据结构解释main()流程图input()流程图 add()流程图 browseall()流程图 browsestudent()流程图 browseclass()流程图 amend()流程图 Delete()流程图 graduation()流程图(3) 各模块中,变量的名称以及用途char class_number30 学生所在班级 char number100 学生的学号 char name100 学生的姓名 int basic_course_credit 基础课学分 int spe
9、cialized_course_credit 专业课学分 int optional_course_credit 选修课学分 int humanities_courses 人文类课程学分 int experimental_course 实验性课程学分(4) 选用的测试数据及测试结果1. 输入密码111进入程序2. 输入两个学生的学分信息3. 输出这两个学生的学分信息4. 添加两个学生的学分信息5. 显示所有学生的学分信息6. 给定学号,输出该学生的学分信息7. 给定班号,输出该班所有学生的学分信息8. 修改学生的number为,name为eee9. 显示修改后所有学生的学分信息10. 删除学生的
10、学分信息11. 显示删除后所有学生的学分信息12. 显示所有学生能毕业的学生数量13. 退出(5) 程序的源代码清单#include <stdio.h>#include <stdlib.h>#define NUM 100 typedef struct CREDIT /*学生学分信息的结构类型*/ char class_number30; /*班级*/ char number100; /*学号*/ char name100; /*姓名*/ int basic_course_credit; /*基础课*/ int specialized_course_credit; /*专
11、业课*/ int optional_course_credit; /*选修课*/ int humanities_courses; /*人文类课程*/ int experimental_course; /*实验性课程*/ CREDIT;void displayMenu();int input(CREDIT s,int n);void browseall(CREDIT s,int n);int add(CREDIT s,int n);void browsestudent(CREDIT s,int n);void browseclass(CREDIT s,int n);void amend(CRED
12、IT s,int n);int Delete(CREDIT s,int n);void graduation(CREDIT s,int n);main() /*主函数*/ CREDIT sNUM; int choice; int n=0; char password20; printf("nEnter password:"); gets(password); if(strcmp(password,"111")=0) printf("nOK!n"); getch(); clrscr(); do displayMenu(); scanf(
13、"%d",&choice); switch(choice) case 1:n=input(s,n);break; case 2:browseall(s,n);break; case 3:n=add(s,n);break; case 4:browsestudent(s,n);break; case 5:browseclass(s,n);break; case 6:amend(s,n);break; case 7:n=Delete(s,n);break; case 8:graduation(s,n);break; clrscr(); while(choice!=0);
14、else printf("nInvalid password!n"); printf("nnByeBye!"); getch() ;void displayMenu() /*显示菜单*/ printf("n=MENU=n"); printf("n1.Input all student's creditn"); printf("n2.Browse all student's creditn"); printf("n3.Add a student's creditn
15、"); printf("n4.Browse a student's creditn"); printf("n5.Browse a class all creditsn"); printf("n6.Amend a student's creditn"); printf("n7.Delete a student's creditn"); printf("n8.Browse how many students can graduaten"); printf("
16、;n0.Exitn"); printf("nchoice(0-8):");int input(CREDIT s,int n) /*输入学分信息*/ int i,a; clrscr(); printf("How many students do you want to input?:"); scanf("%d",&a); printf("n"); n=a; for(i=0;i<a;i+) printf("Please input the student's class_num
17、ber(example:):"); scanf("%s",&si.class_number); printf("Please input the student's number(example:):"); scanf("%s",&si.number); printf("Please input the student's name(not more than 15 letters):"); scanf("%s",&); print
18、f("Please input the basic_course_credit(not more than 50):"); scanf("%d",&si.basic_course_credit); printf("Please input the specialized_course_credit(not more than 50):"); scanf("%d",&si.specialized_course_credit); printf("Please input the optiona
19、l_course_credit(not more than 24):"); scanf("%d",&si.optional_course_credit); printf("Please input the humanities_courses(not more than 8):"); scanf("%d",&si.humanities_courses); printf("Please input the experimental_course(not more than 20):"); s
20、canf("%d",&si.experimental_course); printf("n"); printf("All the informations have been saved!"); getch(); return n;void browseall(CREDIT s,int n) /*浏览学生信息*/ int i; clrscr();printf("nclass_numbertnumbertnametbasic_course_credittspecialized_course_credittoptiona
21、l_course_creditthumanities_coursestexperimental_coursen"); for (i=0;i<n;i+)printf("n%st%st%st%dt%dt%dt%dt%dn",si.class_number,si.number,,si.basic_course_credit,si.specialized_course_credit,si.optional_course_credit,si.humanities_courses,si.experimental_course); getch();int a
22、dd(CREDIT s,int n) /*添加某位学生的学分*/ int i,a; clrscr(); printf("How many students do you want to add?:"); scanf("%d" ,&a); printf("n"); for(i=n;i<a+n;i+) printf("Please input the student's class_number(example:):"); scanf("%s",&si.class_nu
23、mber); printf("Please input the student's number(example:):"); scanf("%s",&si.number); printf("Please input the student's name(not more than 15 letters):"); scanf("%s",&); printf("Please input the basic_course_credit(not more than 5
24、0):"); scanf("%d",&si.basic_course_credit); printf("Please input the specialized_course_credit(not more than 50):"); scanf("%d",&si.specialized_course_credit); printf("Please input the optional_course_credit(not more than 24):"); scanf("%d&qu
25、ot;,&si.optional_course_credit); printf("Please input the humanities_courses(not more than 8):"); scanf("%d",&si.humanities_courses); printf("Please input the experimental_course(not more than 20):"); scanf("%d",&si.experimental_course); printf(&qu
26、ot;n"); n=n+a; printf("The information has been saved successfully!n"); getch(); return n;void browsestudent(CREDIT s,int n) /*显示某位学生学分*/ int i; char a10; clrscr(); printf("Please input the student's number:"); scanf("%s",&a);printf("nclass_numbertnumb
27、ertnametbasic_course_credittspecialized_course_credittoptional_course_creditthumanities_coursestexperimental_coursen"); for(i=0;i<n;i+) if(strcmp(si.number,a)=0)printf("n%st%st%st%dt%dt%dt%dt%dn",si.class_number,si.number,,si.basic_course_credit,si.specialized_course_credit,
28、si.optional_course_credit,si.humanities_courses,si.experimental_course); getch();void browseclass(CREDIT s,int n) /*显示某班所有学生学分*/ int i; char a10; clrscr(); printf("Please input the class number:"); scanf("%s",&a);printf("nclass_numbertnumbertnametbasic_course_credittspec
29、ialized_course_credittoptional_course_creditthumanities_coursestexperimental_coursen"); for(i=0;i<n;i+) if(strcmp(si.class_number,a)=0)printf("n%st%st%st%dt%dt%dt%dt%dn",si.class_number,si.number,,si.basic_course_credit,si.specialized_course_credit,si.optional_course_credit,
30、si.humanities_courses,si.experimental_course); getch();void amend(CREDIT s,int n) /*修改某学生学分*/ int i; char a10; char b; clrscr(); printf("Please input the student's number you want to amend:"); scanf("%s",&a); for(i=0;i<n;i+) if(strcmp(si.number,a)=0) printf("nAre
31、you sure?(Y/N)n"); b=getch(); printf("n"); if(b='y'|b='Y') printf("Please input the student's class_number(example:):"); scanf("%s",&si.class_number); printf("Please input the student's number(example:):"); scanf("%s"
32、,&si.number); printf("Please input the student's name(not more than 15 letters):"); scanf("%s",&); printf("Please input the basic_course_credit(not more than 50):"); scanf("%d",&si.basic_course_credit); printf("Please input the spec
33、ialized_course_credit(not more than 50):"); scanf("%d",&si.specialized_course_credit); printf("Please input the optional_course_credit(not more than 24):"); scanf("%d",&si.optional_course_credit); printf("Please input the humanities_courses(not more th
34、an 8):"); scanf("%d",&si.humanities_courses); printf("Please input the experimental_course(not more than 20):"); scanf("%d",&si.experimental_course); break; if(i=n) printf("nDon't have the student!n"); printf("nFinish! Press any key to re
35、turn."); getch(); int Delete(CREDIT s,int n) /*删除某学生学分*/ int i,j,k; char a,delstudent10; clrscr(); printf("Enter the student number that you want to delete:"); scanf("%s",&delstudent); k=n; for(i=0;i<n;i+) if(strcmp(si.number,delstudent)=0)printf("nclass_numbertn
36、umbertnametbasic_course_credittspecialized_course_credittoptional_course_creditthumanities_coursestexperimental_coursen");printf("n%st%st%st%dt%dt%dt%dt%dn",si.class_number,si.number,,si.basic_course_credit,si.specialized_course_credit,si.optional_course_credit,si.humanities_courses,si.experimental_course); printf("nDo
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 临床质谱检测前处理技师考试试卷及答案
- 七年级语文作文《照片里的故事》主题范文5篇
- 2025年中国建筑地勘中心陕西总队招聘13人笔试历年参考题库附带答案详解
- 2025安徽金柱控股集团有限公司招聘7人笔试历年参考题库附带答案详解
- 2025宁夏电力投资集团社会招聘108人笔试历年参考题库附带答案详解
- 2025四川绵阳交发实业有限责任公司及下属子公司招聘人力资源管理等岗位5人笔试历年参考题库附带答案详解
- 2025四川华丰科技股份有限公司招聘产品设计工程师等岗位96人笔试历年参考题库附带答案详解
- 2025十九冶(雄安)建筑工程有限公司工程项目财务管理人员招聘笔试历年参考题库附带答案详解
- 2025内蒙古聚英人力资源服务有限责任公司定向招聘劳务人员54人笔试历年参考题库附带答案详解
- 2025元洪两国双园(福建)控股集团有限公司招聘3人笔试历年参考题库附带答案详解
- 2025江苏扬州市高邮市城市建设投资集团有限公司招聘拟聘用人员笔试历年参考题库附带答案详解
- 2026年上海安全员c证考试试题及答案
- 易制毒单位内部安全制度
- 2025年运城市人民医院招聘笔试真题
- (二模)石家庄市2026届普通高中高三毕业年级教学质量检测(二)数学试卷(含答案详解)
- 规培医师心理测评试题
- 《建筑施工测量标准》JGJT408-2017
- 经验萃取资料:《组织经验萃取与课程开发》
- 2024年广州市高三二模普通高中毕业班综合测试(二) 英语试卷(含答案)
- 百日安全攻坚行动方案物业
- 三宝科技(湖州)有限公司年产 5000 吨色浆建设项目环评报告
评论
0/150
提交评论