Пример #1
0
void TeaStuDelete(void)
{
	Student* student;
	long id;
	int again;
	do
	{
		system("cls");
		cin.clear();
		cin.sync();

		cout<<strTeaSD1;
		INPUT_INT_L(id,1);
		student=data.StuSearch(id);
		if(student==NULL)
			cout<<strTeaSDF;
		else
		{
			cout<<strTeaSDConfirm1<<student->GetName()<<strTeaSDConfirm2<<student->GetId();
			cout<<strTeaSDConfirm3<<student->GetClass()<<strTeaSDConfirm4;
			int i;
			INPUT_INT_LU(i,0,1);
			if(i)
			{
				data.DelStu(id);
				cout<<strTeaSDS;
			}
		}
		cout<<strTeaSD2;
		INPUT_INT_LU(again,0,1);
	}while(again);
	return;
}
int main()
{
	Student stu;
	char line[200];
	gets(line);
	stu.Init(line);
	printf("%s,%d,%d,%d",stu.GetName().c_str(),stu.GetAge(),stu.GetId(),stu.Average());
	return 0;
}
Пример #3
0
void StuLogin(void)
{
	system("cls");
	cin.clear();
	cin.sync();
	cout<<strInputStuId;
	long id;
	INPUT_INT_L(id,0);
	cout<<strInputStuPassword;
	string password;
	cin>>password;
	Student* student = data.StuSearch(id);
	if(student==NULL||!student->PasswordCheck(password))
	{
		cout<<strInputStuError;
		system("pause");
		return;
	}

	bool quit=false;
	do
	{
		system("cls");
		cin.clear();
		cin.sync();
		int iMenu=-1;
		cout<<strStuWelcome1<<student->GetName()<<endl;
		cout<<strStuWelcome2<<student->GetId()<<endl;
		cout<<strStuWelcome3<<student->GetClass()<<endl;
		cout<<strStuMenu;

		INPUT_INT_LU(iMenu,0,3);
		switch(iMenu)
		{
		case 1:
			StuPasswordChange(student);
			break;
		case 2:
			StuCourseChoose(student);
			break;
		case 3:
			StuGradesQuery(student);
			break;
		case 0:
			quit = true;
			break;
		}
	}while(!quit);
	return;
}
Пример #4
0
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;
}