编程出来说变量没声明,怎么改啊?万分感谢,真的很急!学生信息系统管理

#include
#include
#include
#include
#include
using namespace std;
const int MAX=50;
int count=0;
class Student
{
public:
void Set();
void Add();
friend void Read(string number[],string name[],string sex[],string age[],string nation[],string birthplace[],string birthday[],string facult[],string major[],string grade[]);
int Judge(string num);
int Determine(string nam);
void Delete();
void Change();
void Search();
void Display();
private:
string m_number;
string m_name;
string m_sex;
string m_age;
string m_nation;
string m_birthplace;
string m_birthday;
string m_facult;
string m_major;
string m_grade;
};
.......
void Student::Search(){
string num,number[MAX],name[MAX],sex[MAX],age[MAX],nation[MAX],birthplace[MAX],birthday[MAX],facult[MAX],major[MAX],grade[MAX];
Read(number,name,sex,age,nation,birthplace,birthday,facult,major,grade);
int n;
cout<<"1.按学号查询 2.按姓名查询 请选择:";
cin>>n;

if(n==1){
    cout<<"请输入你要查询的学号:"<<endl;
    cin>>num;

    int k=Judge(num);
    if(k!=-1)
    {
    cout<<"学号\t姓名\t性别\t年龄\t民族\t籍贯\t出生日期\t院系\t专业\t年级"<<endl;
    cout<<number[k]<<"\t";
    cout<<name[k]<<"\t";
    cout<<sex[k]<<"\t";
    cout<<age[k]<<"\t";
    cout<<nation[k]<<"\t";
    cout<<birthplace[k]<<"\t";
    cout<<birthday[k]<<"\t";
    cout<<facult[k]<<"\t";
    cout<<major[k]<<"\t";
    cout<<grade[k]<<endl;
    }
    else
    cout<<"该数据库没有此学生!"<<endl; 
}
    else
    {
    cout<<"请输入你查询的姓名:"<<endl;
    cin>>nam;

    int k=Determine(nam);
    if(k!=-1)
    {
    cout<<"学号\t姓名\t性别\t年龄\t民族\t籍贯\t出生日期\t院系\t专业\t年级"<<endl;
    cout<<number[k]<<"\t";
    cout<<name[k]<<"\t";
    cout<<sex[k]<<"\t";
    cout<<age[k]<<"\t";
    cout<<nation[k]<<"\t";
    cout<<birthplace[k]<<"\t";
    cout<<birthday[k]<<"\t";
    cout<<facult[k]<<"\t";
    cout<<major[k]<<"\t";
    cout<<grade[k]<<endl;   
    }
}

}
C:\Users\ZIMAI\Desktop\aaaa.cpp In member function 'void Student::Search()':
270 8 C:\Users\ZIMAI\Desktop\aaaa.cpp [Error] 'nam' was not declared in this scope
老师让做学生系统管理,查询方法两种按学号和姓名来,但是要怎么改啊?改了好久都不行。。。

查看全部
weixin_39151026
weixin_39151026
2017/06/19 14:40
  • c++
  • 编程
  • 数据库
  • 点赞
  • 收藏
  • 回答
    私信

4个回复