没有合适的资源?快使用搜索试试~ 我知道了~
学生信息管理系统最新升级版代码
3星 · 超过75%的资源 需积分: 10 10 下载量 59 浏览量
2012-04-05
12:21:41
上传
评论
收藏 9KB TXT 举报
温馨提示
试读
11页
学生信息管理系统最新升级版代码 c++版的,希望对大家有用!原创请大家多多指教!
资源推荐
资源详情
资源评论
#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
const int n=5;
const int m=10;
class student{
private:
int ID,english,math,computer,total;
char name[m];
char sex[4];
int chinese;
public:
student(){cout<<"构造函数在执行\n";}
~student(){cout<<"析构函数在执行\n";}
student(student &p);
void Getinfo();
void Print(student st[])const;
int FindID(student st[])const;
char FindName(student st[])const;
void SortName(student st[]);
void SortID(student st[],int (*fun)(int a,int b));
//void SortID(student st[]);
void SortTotal(student st[],int (*fun)(int a,int b));
void SortChinese(student st[],int (*fun)(int a,int b));
void SortMath(student st[],int (*fun)(int a,int b));
void SortEnglish(student st[],int (*fun)(int a,int b));
void SortComputer(student st[],int (*fun)(int a,int b));
void swap(student &,student &);
friend bool checki(string str);
#include<iomanip>
#include<string>
using namespace std;
const int n=5;
const int m=10;
class student{
private:
int ID,english,math,computer,total;
char name[m];
char sex[4];
int chinese;
public:
student(){cout<<"构造函数在执行\n";}
~student(){cout<<"析构函数在执行\n";}
student(student &p);
void Getinfo();
void Print(student st[])const;
int FindID(student st[])const;
char FindName(student st[])const;
void SortName(student st[]);
void SortID(student st[],int (*fun)(int a,int b));
//void SortID(student st[]);
void SortTotal(student st[],int (*fun)(int a,int b));
void SortChinese(student st[],int (*fun)(int a,int b));
void SortMath(student st[],int (*fun)(int a,int b));
void SortEnglish(student st[],int (*fun)(int a,int b));
void SortComputer(student st[],int (*fun)(int a,int b));
void swap(student &,student &);
friend bool checki(string str);
};
#include "student.h"
student::student(student &p)
{
ID=p.ID;chinese=p.chinese;english=p.english;math=p.math;
computer=p.computer;total=p.total;
strcpy_s(name,p.name);strcpy_s(sex,p.sex);
}
bool checki(string str)
{
for(int i=0;i<str.length();i++)
if(str[i]<48||str[i]>58)
return false;
return true;
}
void student::Getinfo()
{
cout<<"请输入学生的姓名\n";cin>>name;
string str;
cout<<"请输入学生的学号\n";cin>>str;
if(!checki(str)) {cout<<"输入格式不正确,请重新输入\n";cin>>str;}
ID=atoi(str.c_str());
cout<<"请输入学生的性别\n";cin>>sex;
cout<<"请输入语文成绩\n";cin>>str;
if(!checki(str)) {cout<<"输入格式不正确,请重新输入\n";cin>>str;}
chinese=atoi(str.c_str());
cout<<"请输入英语成绩\n";cin>>str;
if(!checki(str)) {cout<<"输入格式不正确,请重新输入\n";cin>>str;}
english=atoi(str.c_str());
cout<<"请输入数学成绩\n";cin>>str;
#include "student.h"
student::student(student &p)
{
ID=p.ID;chinese=p.chinese;english=p.english;math=p.math;
computer=p.computer;total=p.total;
strcpy_s(name,p.name);strcpy_s(sex,p.sex);
}
bool checki(string str)
{
for(int i=0;i<str.length();i++)
if(str[i]<48||str[i]>58)
return false;
return true;
}
void student::Getinfo()
{
cout<<"请输入学生的姓名\n";cin>>name;
string str;
cout<<"请输入学生的学号\n";cin>>str;
if(!checki(str)) {cout<<"输入格式不正确,请重新输入\n";cin>>str;}
ID=atoi(str.c_str());
cout<<"请输入学生的性别\n";cin>>sex;
cout<<"请输入语文成绩\n";cin>>str;
if(!checki(str)) {cout<<"输入格式不正确,请重新输入\n";cin>>str;}
chinese=atoi(str.c_str());
cout<<"请输入英语成绩\n";cin>>str;
if(!checki(str)) {cout<<"输入格式不正确,请重新输入\n";cin>>str;}
english=atoi(str.c_str());
cout<<"请输入数学成绩\n";cin>>str;
剩余10页未读,继续阅读
资源评论
- quzhixin2012-04-08使用VB 做的,不是VC,有点欺骗人啊
李荣强
- 粉丝: 34
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功