资源简介
学分管理系统, C++实现,希望对你们有所帮助。。。。。
代码片段和文件信息
#include “stdio.h“
#include “ctype.h“
#include “conio.h“
#include “stdlib.h“
#include “process.h“
#include “string.h“
/*Creat student‘s information data type*/
struct stuinfo{
char num[9];
int base;
int major;
int optional;
int humanity;
int exp;
};
/*Creat link node data type and creat head rear and current pointer*/
struct linkNode{
struct stuinfo data;
struct linkNode *next;
}*first*end*current;
char menu_select(void);/*menu function*/
void EnterCredit(void);/*insert a information*/
void DisplayOne(void);/*display a information*/
void DisplayAll(void);/*display all the information*/
void DisplayClass(void);/*display all the information in the same class*/
void Delete(void);/*delete one information*/
void Modify(void);/*modify one information*/
void Sort();
void SortBybase();
void SortByMajor();
void SortByOptional();
void SortByHum();
void SortByExp();
void Statistic();
int SaveData();/*save the information to binary file and txt file*/
int LoadData();/*load information*/
int IsValid(struct stuinfo);/*test the data whether valid or not*/
void Destroylink(void);/*destroy the link list*/
main()
{
char choice;
first=end=current=NULL;
system(“cls“);/*run dos command to clean screen*/
/*display the menu and get choice then call function*/
for(;;){
choice=menu_select();
switch(choice){
case ‘1‘:EnterCredit();break;
case ‘2‘:DisplayOne();break;
case ‘3‘:DisplayClass();break;
case ‘4‘:Delete();break;
case ‘5‘:Modify();break;
case ‘6‘:Sort();break;
case ‘7‘:Statistic();break;
case ‘8‘:SaveData();break;
case ‘9‘:LoadData();break;
case ‘0‘:Destroylink();return 1;
}
}
}
char menu_select(void)
{
/*Print the menu and get the chioce.*/
char temp=‘\0‘ch=‘\0‘;
system(“cls“);
printf(“1.Enter a student‘s credit.\n“);
printf(“2.Display a student‘s credit by student‘s number.\n“);
printf(“3.Display all the student‘s credit in the same class.\n“);
printf(“4.Delete a student‘s credit by student‘s number.\n“);
printf(“5.Modify a student‘s credit.\n“);
printf(“6.Sort the information by one credit.\n“);
printf(“7.List some statistic.\n“);
printf(“8.Save data to file.\n“);
printf(“9.Load data to file.\n“);
printf(“0.Exit System.\n“);
printf(“Enter your choice:“);
/*using getch() function get choice and using enter key to confirm*/
while(!isdigit(temp)&&temp!=‘\10‘&&temp!=‘\15‘){
temp=getch();
if(isdigit(ch)){
if(temp==‘\15‘)break;
if(temp==‘\10‘){
ch=‘\0‘;
putchar(temp);
putchar(‘ ‘);
putchar(temp);
temp=‘\0‘;
}
}
else if(isdigit(temp)){
ch=temp;
putc
- 上一篇:单片机控制按键播放音乐
- 下一篇:TI SHA_256 源码及例程
相关资源
- 国际象棋的qt源代码
- 操作系统c语言模拟文件管理系统844
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- C语言课程设计
- 使用C语言编写的病房管理系统
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- 简易教务管理系统c语言开发文档
- 操作系统课设 读写者问题 c语言实现
- C++纯文字DOS超小RPG游戏
- 个人日常财务管理系统(C语言)
- MFC数字钟(基于VC6.0)
- c语言电子商务系统
- VC++MFC小游戏实例教程(实例)+MFC类库
- c语言 教学信息管理系统
- 手机话费管理系统(c语言编写)
- 餐饮管理系统(C语言编写)
- 用c语言编写的学生选课系统
- C语言 学生信息管理系统 源代码
- 我的C语言寒假作业-学生通讯录系统(
- 连铸温度场计算程序(C++)
- C语言进阶——嵌入式系统高级C语言编
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
评论
共有 条评论