1.学生籍贯信息记录簿设计(C源程序
2.学生籍贯是学生信息填中国吗
3.用c++编写一个五百行的学生学籍管理系统!!籍贯急急急
4.学生籍贯正确填写方式?
学生籍贯信息记录簿设计(C源程序
我也在做课设,簿源和你一样的学生信息题目。下面是籍贯我自己做的。最后一个功能没有实现。簿源怎么更改后台源码有空交流。学生信息e-mail: jy@.com
#include<iostream.h>
#include<string.h>
#include<fstream.h>
#include<stdlib.h>
class stu
{
char name[];
int number;
char bornplace[];
public:
stu()
{
}
stu(char n[],籍贯int num,char born[])
{
strcpy(name,n);
number=num;
strcpy(bornplace,born);
}
friend void main();
};
void main()
{
cout<<"请选择您需要的操作!"<<endl;
cout<<" 操作:"<<endl;
cout<<"(0)数据录入"<<endl;
cout<<"(1)增加人员"<<endl;
cout<<"(2)删除人员"<<endl;
cout<<"(3)修改数据"<<endl;
cout<<" 查询:"<<endl;
cout<<"(4)按姓名查询"<<endl;
cout<<"(5)按学号查询"<<endl;
cout<<"(6)输出所有学生的簿源籍贯信息"<<endl;
cout<<"(7)按籍贯查询"<<endl;
cout<<"选择相关操作请输入相对的括号里的阿拉伯数字!"<<endl;
char p;char w;
stu *s[];
ofstream *file[];
int i=0;
int j=0;
bool flag2=0;
do
{
cin>>p;
if((p>='0'&&p<='6'))
flag2=1;
else
cout<<"指令错误!学生信息请重新输入:"<<endl;
}while(flag2==0);
do{
switch(p)
{
case '0':
{
char c;
char name[],籍贯bornplace[];int number;
do{
cout<<"请输入姓名"<<endl;
cin>>name;
cout<<"请输入学号:"<<endl;
cin>>number;
cout<<"请输入籍贯:"<<endl;
cin>>bornplace;
file[j]=new ofstream("d:\\document.txt",ios::ate);
*file[j]<<"姓名"<<name<<"学号"<<number<<"籍贯"<<bornplace <<endl;
j++;
s[i]=new stu(name,number,bornplace);
i++;
cout<<"数据录入成功,想继续录入吗(y/n)"<<endl;
cin>>c;
flag2=0;
do
{
if(c!='y'&&c!='n')
{
cout<<"指令错误!簿源请重新输入!学生信息"<<endl;
cin>>c;
}
else
flag2=1;
}
while(flag2==0);
}
while(c=='y');
break;
}
case '4':
{
char t[];
char c;
do
{
int flag1=0;
cout<<"请输入你要查询学生的籍贯姓名"<<endl;
cin>>t;
for(int q=0;q<i;q++)
{
if(strcmp((*s[q]).name,t)==0)
{
flag1=1;
cout<<"您要查询的学生是:"<<(*s[q]).name<<"学号是:"<<(*s[q]).number<<"籍贯是:"<<(*s[q]).bornplace<<endl;
}
}
if(flag1==0)
cout<<"对不起!您要查询的簿源学生不存在!"<<endl;
cout<<"您想继续查询吗?(y/n)"<<endl;
cin>>c;
if(c!='y'&&c!='n')
{
cout<<"指令错误!请重新输入!源码300"<<endl;
cin>>c;
}
}
while(c=='y');
break;
}
case '5':
{
int n ;int j=0;char c;
do{
int flag=0;
cout<<"请输入你要查询的学生学号:"<<endl;
cin>>n;
for(int j=0;j<i;j++)
{ int no=((*s[j]).number);
if(no==n)
{
flag=1;
cout<<"您要查询的学生是:"<<(*s[j]).name<<endl;
cout<<"籍贯是:"<<(*s[j]).bornplace<<endl;
}
}
if(flag==0)
cout<<"对不起!您要查询的学生不存在!"<<endl;
cout<<"您想继续查询吗?(y/n)"<<endl;
cin>>c;
if(c!='y'&&c!='n')
{
cout<<"指令错误!请重新输入!"<<endl;
cin>>c;
}
}
while(c=='y');
break;
}
case '7':
{
char m[];int j=0;char c;
do{
int flag=0;
cout<<"请输入你要查询籍贯:"<<endl;
cin>>m;
for(int w=0;w<i;w++)
{
if(strcmp((*s[w]).bornplace,m)==0)
{
flag=1;
cout<<"您要查询的学生是:"<<(*s[w]).name<<endl;
cout<<"学号是:"<<(*s[w]).number<<endl;
}
}
if(flag==0)
cout<<"对不起!您要查询的学生不存在!"<<endl;
cout<<"您想继续查询吗?(y/n)"<<endl;
cin>>c;
if(c!='y'&&c!='n')
{
cout<<"指令错误!请重新输入!"<<endl;
cin>>c;
}
}
while(c=='y');
break;
}
case '1':
{
char name[],bornplace[];int number;
char c;
do
{
cout<<"请输入您要增加的学生的姓名:"<<endl;
cin>>name;
cout<<"请输入学号:"<<endl;
cin>>number;
cout<<"请输入籍贯:"<<endl;
cin>>bornplace;
file[j]=new ofstream("d:\\document",ios::ate);
*file[j]<<"姓名"<<name<<"学号"<<number<<"籍贯"<<bornplace<<endl;
j++;
s[i]=new stu(name,number,bornplace);
i++;
cout<<"数据录入成功,想继续录入吗(y/n)"<<endl;
cin>>c;
if(c!='y'&&c!='n')
{
cout<<"指令错误!请重新输入!"<<endl;
cin>>c;
}
}while(c=='y');
break;
}
case '2':
{
char name[];bool flag3=0;char c;
do{
cout<<"请输入您要删除的300源码学生姓名:"<<endl;
cin>>name;
for(int h=0;h<i;h++)
{
if(strcmp(name,s[h]->name)==0)
{
flag3=1;
i--;
do{
s[h]=s[h+1];
h++;
}while(h<=i);
}
}
if(flag3==0)
cout<<"您要求删除的对象本来就不存在!请检查输入的正确性!";
cout<<"要继续删除吗?(y/n)"<<endl;
cin>>c;
if(c!='y'&&c!='n')
{
cout<<"指令错误!请重新输入!"<<endl;
cin>>c;
}
}while(c=='y');
break;
}
case '3':
{
char name[],born[];int num;;flag2=0;
char c;
do
{
cout<<"请输入您要修改的学生的姓名:"<<endl;
cin>>name;
for(int h=0;h<i;h++)
{
if(strcmp(name,s[h]->name)==0)
{
flag2=1;
cout<<"请输入新的学号:"<<endl;
cin>>num;
cout<<"请输入新的籍贯:"<<endl;
cin>>born;
s[h]->number=num;
strcpy(s[h]->bornplace,born);
cout<<"数据修改成功!";
}
}
if(flag2==0)
{
cout<<"您要修改的学生本来就不存在!请检查重新输入!"<<endl;
}
cout<<"想继续修改吗(y/n)"<<endl;
cin>>c;
if(c!='y'&&c!='n')
{
cout<<"指令错误!请重新输入!交换源码"<<endl;
cin>>c;
}
}while(c=='y');
break;
}
case '6':
{
cout<<"本系统所有学生的籍贯信息如下:"<<endl;
if(i==0)
cout<<"管理系统中没有录入数据或者数据已经被删除!"<<endl;
for(int k=0;k<i;k++)
{
cout<<k+1<<" "<<"姓名:"<<" "<<s[k]->name<<" "<<
"学号:"<<" "<<s[k]->number<<" "<<"籍贯:"<<" "<<s[k]->bornplace
<<endl;
}
break;
}
}
cout<<"您想继续进行其他操作吗?(y/n)"<<endl;
bool flag4=0;
do
{
cin>>w;
if(w!='y'&&w!='n')
cout<<"指令错误!请重新输入!"<<endl;
else
flag4=1;
}while(flag4==0);
if(w=='y')
{ cout<<"请选择您需要的操作!"<<endl;
cout<<" 操作:"<<endl;
cout<<"(0)数据录入"<<endl;
cout<<"(1)增加人员"<<endl;
cout<<"(2)删除人员"<<endl;
cout<<"(3)修改数据"<<endl;
cout<<" 查询:"<<endl;
cout<<"(4)按姓名查询"<<endl;
cout<<"(5)按学号查询"<<endl;
cout<<"(6)输出所有学生的籍贯信息"<<endl;
cout<<"(7)按籍贯查询"<<endl;
cout<<"选择相关操作请输入相对的括号里的阿拉伯数字!"<<endl;
}
cin>>p;
}while(w=='y');
for(int x=0;x<i;x++)
{
delete s[x];
cout<<"delete all members!"<<endl;
}
}
学生籍贯是填中国吗
学生籍贯不是填中国。一般是在国籍栏处填中国,籍贯是原创源码本人出生时祖父的居住地,登记填至县级行政区划,只需要精确到省份和城市即可,如XX省(或自治区、直辖市)XX市或XX县。
籍贯和所住的地方没有关系,想知道自己的籍贯在哪,可以翻开户口本,看籍贯那一栏写的是哪里,籍贯就在哪里。
填籍贯时,不能确定祖父居住地的,随父亲籍贯,不能确定父亲籍贯的,登记本人的出生地,父亲是外国人或《出生医学证明》未记载父亲信息的,随母亲籍贯,弃婴等籍贯不详的,登记收养人籍贯或收养机构所在地的县级行政区划。
如果本人实际籍贯与户口登记不一致、籍贯地行政区划调整或名称变动、被收养随养父籍贯的,可以向公安部门申报变更籍贯登记。
用c++编写一个五百行的学生学籍管理系统!!急急急
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
typedef struct student {
unsigned m_id;
string m_name;
unsigned m_age;
string m_sex;
string m_address;
string m_contact;
string m_dormitory;
struct student *m_next;
}student;
class CStudent {
private :
student *head;
public :
CStudent() {
head = new student;
head->m_id = 0;
head->m_name = "noname";
head->m_next = NULL;
}
~CStudent() {
student *p = head,*q;
while(p) {
q = p;
p = q->m_next;
delete q;
}
}
student readdata(int model); // model = 1:不读取学号,2:不读取姓名,其他,读取所有信息
void entering();
bool insert(const student &astu);
student *findid(unsigned id) const;
student *findname(const string &name) const;
student *findsex(const string &sex) const;
student *finddormitory(const string &dormitory) const;
unsigned boys() const;
unsigned girls() const;
unsigned headcount() const;
bool eraseid();
bool erasename();
bool modifyid();
bool modifyname();
void Show() const;
void query() const;
void friend statistics(const CStudent &aclss);
void friend erase(CStudent &aclss);
void friend modify(CStudent &aclss);
};
string readstring() {
string str;
while(cin.get() != '\n');
cin >> str;
return str;
}
student CStudent::readdata(int model) {
student tmp;
if(model != 1) { cout << "学 号: "; cin >> tmp.m_id; }
if(model != 2) { cout << "姓 名: "; tmp.m_name = readstring(); }
cin >> tmp.m_age;
cout << "性 别: ";
tmp.m_sex = readstring();
cout << "住 址: ";
tmp.m_address = readstring();
cout << "****: ";
tmp.m_contact =readstring();
cout << "寝 室: ";
tmp.m_dormitory = readstring();
return tmp;
}
void CStudent::entering() {
student tmp;
cout << "学号(0 to return): ";
cin >> tmp.m_id;
while(tmp.m_id) {
if(findid(tmp.m_id) == NULL) {
cout << "姓 名: ";
tmp.m_name = readstring();
cout << "年 龄: ";
cin >> tmp.m_age;
cout << "性 别: ";
tmp.m_sex = readstring();
cout << "住 址: ";
tmp.m_address = readstring();
cout << "****: ";
tmp.m_contact = readstring();
cout << "寝 室: ";
tmp.m_dormitory = readstring();
insert(tmp);
}
else cout << "重复的学号:" << tmp.m_id << endl;
cout << "学号(0 to return): ";
cin >> tmp.m_id;
}
}
student *CStudent::findid(unsigned id) const {
student *p;
for(p = head; p->m_next; p = p->m_next)
if(p->m_next->m_id == id) return p;
return NULL;
}
student *CStudent::findname(const string &name) const {
student *p;
for(p = head; p->m_next; p = p->m_next)
if(p->m_next->m_name == name) return p;
return NULL;
}
student *CStudent::findsex(const string &sex) const {
student *p;
for(p = head; p->m_next; p = p->m_next)
if(p->m_next->m_sex == sex) return p;
return NULL;
}
student *CStudent::finddormitory(const string &dormitory) const {
student *p;
for(p = head; p->m_next; p = p->m_next)
if(p->m_next->m_dormitory == dormitory) return p;
return NULL;
}
bool CStudent::insert(const student &astu) {
student *newnode,*p = head;
if(p->m_next == NULL) {
p->m_next = new student(astu);
p->m_next->m_next = NULL;
return true;
}
while(p->m_next) {
if(p->m_next->m_id == astu.m_id) {
cout << "重复的学号,插入失败!\n";
return false;
}
if(p->m_next->m_id > astu.m_id) {
newnode = new student(astu);
newnode->m_next = p->m_next;
p->m_next = newnode;
return true;
}
p = p->m_next;
}
p->m_next = new student(astu);
p->m_next->m_next = NULL;
return true;
}
unsigned CStudent::boys() const {
unsigned cnt = 0;
student *p;
for(p = head->m_next; p; p = p->m_next)
if(p->m_sex == "男") ++cnt;
return cnt;
}
unsigned CStudent::girls() const {
unsigned cnt = 0;
student *p;
for(p = head->m_next; p; p = p->m_next)
if(p->m_sex == "女") ++cnt;
return cnt;
}
unsigned CStudent::headcount() const {
unsigned cnt = 0;
student *p;
for(p = head->m_next; p; p = p->m_next,++cnt);
return cnt;
}
bool CStudent::eraseid() {
student *q,*p;
unsigned id;
cout << "输入要删除的学号:";
cin >> id;
p = findid(id);
if(p == NULL) {
cout << "没有找到学号是\"" << id << "\"的学生,删除失败!\n";
return false;
}
q = p->m_next;
p->m_next = q->m_next;
delete q;
return true;
}
bool CStudent::erasename() {
student *q,*p;
string name;
cout << "输入要删除人的姓名:";
name = readstring();
p = findname(name);
if(p == NULL) {
cout << "没有找到姓名是\"" << name << "\"的学生,删除失败!\n";
return false;
}
q = p->m_next;
p->m_next = q->m_next;
delete q;
return true;
}
bool CStudent::modifyid() {
student tmp,*p;
unsigned id;
cout << "输入要修改的学号:";
cin >> id;
p = findid(id);
if(p == NULL) {
cout << "没有找到学号是\"" << id << "\"的学生,修改失败!\n";
return false;
}
tmp = readdata(1);
tmp.m_id = id;
*p = tmp;
return true;
}
bool CStudent::modifyname() {
student *p,tmp;
string name;
cout << "输入要修改人的姓名:";
name = readstring();
p = findname(name);
if(p == NULL) {
cout << "没有找到姓名是\"" << name << "\"的学生,修改失败!\n";
return false;
}
tmp = readdata(2);
tmp.m_name = name;
*p = tmp;
return true;
}
int menu() {
int choice;
do {
system("cls");
cout << "\t