| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 672 人关注过本帖
标题:[求助] 希望大家帮个忙~~~~~
只看楼主 加入收藏
妖妖1860
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2004-11-13
收藏
 问题点数:0 回复次数:1 
[求助] 希望大家帮个忙~~~~~

学分管理程序

【题目描述】

请设计一个学生的学分管理程序。

假设每位学生必须完成基础课50学分、专业课50学分、选修课24学分、人文类课程8学分、实验性课程20学分才能够毕业。因此在管理学分时,要考虑每个学分所属于的课程类别。

该程序应该具有下列功能:

(1) 录入某位学生的学分;

(2) 给定学号,显示某位学生的学分完成情况;

(3) 给定某个班级的班号,显示该班所有学生学分完成情况;

(4) 给定某位学生的学号,修改该学生的学分信息;

(5) 按照某类课程的学分高低进行排序;

(6) 提供一些统计各类信息的功能。

【题目要求】

(1) 按照分析、设计、编码、调试和测试的软件开发过程完成这个应用程序;

(2) 学分信息应该包括学号、姓名、课程类别、学分等;

(3) 为各项操作功能设计一个菜单。应用程序运行后,先显示这个菜单,然后用户通过菜单项选择希望进行的操作项目。

【输入要求】

应用程序运行后,在屏幕上显示一个菜单。用户可以根据需求,选定相应的操作项目。进入每个操作后,根据应用程序的提示信息,从键盘输入相应的信息。

【输出要求】

(1) 应用程序运行后,要在屏幕上显示一个菜单;

(2) 要求用户输入数据时,要给出清晰、明确的提示信息,包括输入的数据内容、格式及结束方式等。

【考核方式】

运行应用程序,由老师任意选择若干项操作,检测运行效果。

【提示】

设计一个结构类型和一维数组类型,用来保存学分信息。

老师给开头是:

#include <stdio.h> #include <stdlib.h> #define MUNMAX 5 struct studentInfo{ int num; char* name; char sex; int age; float score; }; struct stuType{ studentInfo stu[MUNMAX]; int num; }; void DisplayMenu(); int choiceItem(); void Init(struct stuType*); void PrintInfo(struct stuType); void Print_aInfo(struct stuType,int); void Input_aInfo(struct studentInfo*); void Input_allInfo(struct stuType*,int num); int Search(struct stuType); void Modify(struct stuType*); void main() { struct stuType student; int choice,index; Init(&student); do{ choice=choiceItem(); switch (choice){ case 0:printf("\nWelcome to");break; case 1:Input_allInfo(&student,MUNMAX);break; case 2:Input_allInfo(&student,1); break; case 3:PrintInfo(student);break; case 4:Init(&student);break; case 5:if ((index=Search(student))!=-1) Print_aInfo(student,index); else printf("\n No eixst the student."); break; case 6:Modify(&student);break; } }while(choice); } void DisplayMenu() { printf("\n========= MENU ========="); printf("\n Input more student's informations ......... 1"); printf("\n Input a student's informations ............ 2"); printf("\n Print student's informations .............. 3"); printf("\n Init student's informations ............... 4"); printf("\n Search student's information .............. 5"); printf("\n Modify student's information .............. 6"); printf("\n exit system ............................... 0"); printf("\nchoice,please:"); } int choiceItem() { int choice; do{ DisplayMenu(); scanf("%d",&choice); }while(choice<0||choice>6); return choice; } void Init(struct stuType* s) { s->num=0; } void Print_aInfo(struct stuType s,int index) { printf("\n%4d %-16s",s.stu[index].num,s.stu[index].name); if (s.stu[index].sex==0) putchar('f'); else putchar('m'); printf("%4d%6.1f",s.stu[index].age,s.stu[index].score); } void PrintInfo(struct stuType s) { if (s.num==0) { printf("\nNo student."); return; } for (int i=0;i<s.num;i++){ printf("\n%4d %-16s",s.stu[i].num,s.stu[i].name); if (s.stu[i].sex==0) putchar('f'); else putchar('m'); printf("%4d%6.1f",s.stu[i].age,s.stu[i].score); } } void Input_aInfo(struct studentInfo* as) { scanf("%d",&as->num); as->name=(char*)malloc(30); scanf("%s",as->name); as->sex=random(2); as->age=random(10)+18; as->score=random(100); } void Input_allInfo(struct stuType* s,int num) { printf("\nEnter %d infomations.\n",num); for (int i=0;i<num;i++){ if (s->num==MUNMAX){ printf("\nOverflow."); break; } Input_aInfo(&s->stu[s->num++]); } } int Search(struct stuType stu) { int num; printf("\nEnter num:"); scanf("%d",&num); for (int i=0;i<stu.num;i++) if (stu.stu[i].num==num) return i; return -1; } void Modify(struct stuType*) { }

希望会的朋友加我的Q说....... 号码1516195 谢谢了..................

搜索更多相关主题的帖子: 管理程序 管理学 center 专业课 选修课 
2004-11-13 18:36
live41
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:67
帖 子:12442
专家分:0
注 册:2004-7-22
收藏
得分:0 
提示: 该帖被管理员或版主屏蔽
2004-11-13 19:18
快速回复:[求助] 希望大家帮个忙~~~~~
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014869 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved