本文整理汇总了C++中Student::SetClass方法的典型用法代码示例。如果您正苦于以下问题:C++ Student::SetClass方法的具体用法?C++ Student::SetClass怎么用?C++ Student::SetClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student::SetClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TeaStuAdd
//三级函数 of TeaStuManage
void TeaStuAdd(void)
{
int s, again;
Student stuNew;
string name; long id; string Class;
do
{
do
{
system("cls");
cin.clear();
cin.sync();
cout<<strTeaSA1;
cin>>name;
cout<<strTeaSA2;
INPUT_INT_L(id,1);
cout<<strTeaSA3;
cin>>Class;
cout<<strTeaSAConfirm1<<name<<' '<<id<<' '<<Class<<' ';
cout<<strTeaSAConfirm2<<strStuPassword<<strTeaSAConfirm3;
INPUT_INT_LU(s,0,2);
}while(s==2);
if(s==0) return;
//else (s==1)
stuNew.SetName(name);
stuNew.SetId(id);
stuNew.SetClass(Class);
stuNew.SetPassword(strStuPassword); //初始密码
if(data.AddStu(stuNew))
cout<<strTeaSAS;
else
cout<<strTeaSAF; //学号冲突
INPUT_INT_LU(again,0,1);
}while(again==1);
return;
}
示例2: TeaStuChange
void TeaStuChange(void)
{
Student* student;
long id;
int again;
do
{
system("cls");
cin.clear();
cin.sync();
cout<<strTeaSC1;
INPUT_INT_L(id,1);
student=data.StuSearch(id);
if(student==NULL)
cout<<strTeaSCF;
else
{
cout<<strTeaSCConfirm1<<student->GetName()<<strTeaSCConfirm2<<student->GetId();
cout<<strTeaSCConfirm3<<student->GetClass()<<strTeaSCConfirm4;
int i;
INPUT_INT_LU(i,0,1);
if(i)
{
string Class;
cout<<strTeaSC2;
cin>>Class;
student->SetClass(Class);
cout<<strTeaSCS;
}
}
cout<<strTeaSC3;
INPUT_INT_LU(again,0,1);
}while(again);
return;
}
示例3: StartProcess
void StartProcess(void)
{
fstream file("data.dat", ios_base::in);// attempt open for read
if (!file)
{
// file doesn't exist; create a new one
file.open("data.dat", ios_base::out);
file.close();
return;
}
else //ok, file exists
{
int iStudent=0, iCourse=0;
string TeaPassword;
file>>iStudent;
for(int i=0; i<iStudent; ++i)
{
Student temStu;
string name;
long id;
string Class;
string password;
file>>name>>id>>Class>>password;
temStu.SetName(name);
temStu.SetId(id);
temStu.SetClass(Class);
temStu.SetPassword(password);
int n;
file>>n;
int *cn=new int[n], *grade=new int[n];
for(int i=0; i<n; ++i)
file>>cn[i]>>grade[i];
temStu.Initialize(n,cn,grade);
delete[] cn;
delete[] grade;
data.AddStu(temStu);
{}
}
file>>iCourse;
for(int i=0; i<iCourse; ++i)
{
Course temCou;
string name;
int Number;
int credit;
file>>name>>Number>>credit;
temCou.SetName(name);
temCou.SetNumber(Number);
temCou.SetCredit(credit);
int n;
file>>n;
int *id=new int[n], *grade=new int[n];
for(int i=0; i<n; ++i)
file>>id[i]>>grade[i];
temCou.Initialize(n,id,grade);
delete[] id;
delete[] grade;
data.AddCou(temCou);
}
file>>TeaPassword;
data.SetTeaPassword(TeaPassword);
file.close();
}
return;
}