ImageVerifierCode 换一换
格式:DOCX , 页数:33 ,大小:841.96KB ,
资源ID:9017444      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/9017444.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C语言学分管理程序.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

C语言学分管理程序.docx

1、C语言学分管理程序C语言学分管理程序学分管理程序学号:_11055109_姓名:_鲁文轩_完成日期:2012年5月【题目描述的内容】请设计一个学生的学分管理程序。假设每位学生必须完成基础课50学分、专业课50学分、选修课24学分、人文类课程8学分、实验性课程20学分才能够毕业。因此在管理学分时,要考虑每个学分所属于的课程类别。该程序应该具有下列功能:(1)录入全部学生的学分信息;(2)显示全部学生的学分信息; (3) 添加某位学生的学分; (4) 给定学号,显示某位学生的学分完成情况;(5) 给定某个班级的班号,显示该班所有学生学分完成情况; (6) 给定某位学生的学号,修改该学生的学分信息,

2、 要求有修改确认; (7) 给定某位学生的学号,删除该学生的学分信息,要求有删除确认;(8) 提供一些统计各类信息的功能(如按照某类课程的学分高低进行排序、某类课程的平均学分、最高学分、最低学分,能够毕业的学生人数等)。【题目要求】(1) 按照分析、设计、编码、调试和测试的软件开发过程完成这个应用程序;(2) 学分信息应该包括学号、姓名、课程类别、学分等;(3) 为各项操作功能设计一个菜单。应用程序运行后,先显示这个菜单,然后用户通过菜单项选择希望进行的操作项目。【输入要求】应用程序运行后,在屏幕上显示一个菜单。用户可以根据需求,选定相应的操作项目。进入每个操作后(若需要,还可显示子菜单),根

3、据应用程序的提示信息,从键盘输入相应的信息。要求用户输入数据时,要给出清晰、明确的提示信息,包括输入的数据内容、格式及结束方式等。【输出要求】(1) 应用程序运行后,要在屏幕上显示一个菜单;(2) 要求用户输入数据时,要给出清晰、明确的提示信息,包括输入的数据内容、格式及结束方式等。【提示】设计一个结构类型(含学生的学号、姓名、课程类别、学分等)和一个该结构类型的一维数组(存放若干学生的学分信息)。【用户文档的内容】(1)应用程序功能的详细说明1.录入全部学生的学分信息。2.显示全部学生的学分信息。3.添加某位学生的学分。4.给定学号,显示某位学生的学分完成情况。5.给定某个班级的班号,显示该

4、班所有学生学分完成情况。6.给定某位学生的学号,修改该学生的学分信息, 要求有修改确认。7.给定某位学生的学号,删除该学生的学分信息,要求有删除确认。8.显示全部学生能毕业的人数。1.退出系统。(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 name10

5、0; 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 调用vo

6、id 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 brows

7、eall(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 gradu

8、ation(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)选用的测试数据及测试结果2.输入密码111进入程序3.输入两个学生的学分信息4.输出这两个学生的学分信息5.添加两个学生的学分信息6.显示所有学生的学分信息7.给定学号11055102,输出该学生的学分信息8.给定班号110511,输出该班所有学生的学分信息9.修改学生11051102的number为11051103,name为eee10.显示

10、修改后所有学生的学分信息11.删除学生11051103的学分信息12.显示删除后所有学生的学分信息13.显示所有学生能毕业的学生数量14.退出(5) 程序的源代码清单#include #include #define NUM 100 typedef struct CREDIT /*学生学分信息的结构类型*/ char class_number30; /*班级*/ char number100; /*学号*/ char name100; /*姓名*/ int basic_course_credit; /*基础课*/ int specialized_course_credit; /*专业课*/ i

11、nt 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(CREDIT s,i

12、nt 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(%d,&choice); switch(choice) case 1:n=input

13、(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); else printf(nInvalid password!n); printf(nnByeBye!); getch

14、() ;void displayMenu() /*显示菜单*/ printf(n=MENU=n); printf(n1.Input all students creditn); printf(n2.Browse all students creditn); printf(n3.Add a students creditn); printf(n4.Browse a students creditn); printf(n5.Browse a class all creditsn); printf(n6.Amend a students creditn); printf(n7.Delete a st

15、udents creditn); printf(n8.Browse how many students can graduaten); printf(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;ia;i+) printf(Please input the students class_num

16、ber(example:110551):); scanf(%s,&si.class_number); printf(Please input the students number(example:11055101):); scanf(%s,&si.number); printf(Please input the students name(not more than 15 letters):); scanf(%s,&si.name); printf(Please input the basic_course_credit(not more than 50):); scanf(%d,&si.b

17、asic_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,&si.optional_course_credit); printf(Please input the humanities_courses(not more than 8):)

18、; scanf(%d,&si.humanities_courses); printf(Please input the experimental_course(not more than 20):); scanf(%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_numbertnumbertna

19、metbasic_course_credittspecialized_course_credittoptional_course_creditthumanities_coursestexperimental_coursen); for (i=0;in;i+)printf(n%st%st%st%dt%dt%dt%dt%dn,si.class_number,si.number,si.name,si.basic_course_credit,si.specialized_course_credit,si.optional_course_credit,si.humanities_courses,si.e

20、xperimental_course); getch();int add(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;ia+n;i+) printf(Please input the students class_number(example:110551):); scanf(%s,&si.class_number); printf(Please input the student

21、s number(example:11055101):); scanf(%s,&si.number); printf(Please input the students name(not more than 15 letters):); scanf(%s,&si.name); printf(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 th

22、an 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 than 8):); scanf(%d,&si.humanities_courses); printf(Please input the experimental_course(no

23、t more than 20):); scanf(%d,&si.experimental_course); printf(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 students number:); scanf(%s,&a);printf(nclass_numbertnum

24、bertnametbasic_course_credittspecialized_course_credittoptional_course_creditthumanities_coursestexperimental_coursen); for(i=0;in;i+) if(strcmp(si.number,a)=0)printf(n%st%st%st%dt%dt%dt%dt%dn,si.class_number,si.number,si.name,si.basic_course_credit,si.specialized_course_credit,si.optional_course_cr

25、edit,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_credittspecialized_course_credittoptional_course_creditthumanities

26、_coursestexperimental_coursen); for(i=0;in;i+) if(strcmp(si.class_number,a)=0)printf(n%st%st%st%dt%dt%dt%dt%dn,si.class_number,si.number,si.name,si.basic_course_credit,si.specialized_course_credit,si.optional_course_credit,si.humanities_courses,si.experimental_course); getch();void amend(CREDIT s,in

27、t n) /*修改某学生学分*/ int i; char a10; char b; clrscr(); printf(Please input the students number you want to amend:); scanf(%s,&a); for(i=0;in;i+) if(strcmp(si.number,a)=0) printf(nAre you sure(Y/N)n); b=getch(); printf(n); if(b=y|b=Y) printf(Please input the students class_number(example:110551):); scan

28、f(%s,&si.class_number); printf(Please input the students number(example:11055101):); scanf(%s,&si.number); printf(Please input the students name(not more than 15 letters):); scanf(%s,&si.name); printf(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 optio

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1