- 15
- 0
- 约1.73万字
- 约 21页
- 2017-01-01 发布于重庆
- 举报
vc学生信息管理系统.
vc学生信息管理系统
悬赏分:0 - 解决时间:2008-6-11 16:46
1)能够从屏幕上读取一个学生的信息并将信息存入到数据文件中。
2)能够将指定的信息从文件中删除。
3)能够按编号、姓名对学生的信息进行检索并将检索结果显示在屏幕上。
4)可以统计全部学生的总成绩,及其在班上的排名。
5)能够统计各科的平均成绩及及格率。
6)要求有错误提示功能,例如性别只能输入男女,输入错误提示重新输入。
7)如果检索不到相应的信息应提示用户。
#include iostream.h
#include iomanip.h
#include fstream
#include vector
#include malloc.h
#include stdlib.h
#include string
#include process.h
#include stdio.h
//#define NULL 0
int const Q=20;
#define LEN sizeof(struct student)
using namespace std;
int n=0; //定义一个全局变量统计学生人数
//——---------定义一个学生考试信息的结构体
struct student
{
char name[Q]; //用来存放姓名的
char sex[Q]; //用来存放性别的
long int id; //用来存放准考证号的
int score[4]; //用来存放分数的
int total; //用来存放总分数的
struct student *next;
};
//student向量容器
vector student stu;
//--------------学生类
class Information
{
public:
Information() ; //构造函数.
~Information() ; //析构函数.
student *creat();//建立链表函数。
void output(student *head);
int count(student *head);//定义函数count()统计考生总数
student *insert(student*head);//指针函数*insert()用来添加考生信息.
student *cancel(student *head,long int num);//指针函数*cancel()用来删除考生信息.
student *find(student *head,long int num); //指针函数*find()用来查找考生信息.
void inorder(student *head);//定义inorder()函数将考生的总分从大到小排列并输出
void average( student *head);//求学生成绩的平均分的函数
void save(student *head);//保存函数
student *Read();//读取函数
private:
student *p1,*p2,*p3,*head,st;
};
Information::Information()
{
cout ******************************************************************************\n;
cout ------------------------欢迎您使用学生成绩管理系统------------------------\n;
cout ******************************************************************************\n\n;
}
Information::~Information()
{
cout ******************************************************************************\n;
cout ------------------------谢谢您使用学生成绩管理系统------------------------\n;
cout ******************************************************************************\n;
}
student *Information::creat(void)
{//定义一个指向struct s
原创力文档

文档评论(0)