代码拉取完成,页面将自动刷新
#include "organize.h"
Student s;
void printTitle()
{
system("cls");
cout << "==========Student Client==========\n";
cout << "-------------Options-------------\n";
cout << "1.change password 2.view scores\n";
cout << "3.exit\n---------------------------------\n";
cout << "What do you want to do? Input the serial number:";
}
bool login(Student &s)
{
system("cls");
cout << "==========Student Client==========\n";
cout << "Login with your id:";
string id, pswd;
cin >> id;
s = findStudentById(id, "./data/studentInfo.txt");
while (s.id == "#")
{
cout << "No such id. Please try again!\nLogin with your id:";
cin >> id;
s = findStudentById(id, "./data/studentInfo.txt");
}
cout << id << "'s password:";
cin >> pswd;
if (pswd == s.password)
return true;
else
return false;
}
void viewScore()
{
return;
}
int main()
{
while (!login(s))
{
cout << "Your id or password is wrong. Please try again!\n";
system("pause");
}
cout << "Welcome! " << s.name << '!' << endl;
system("pause");
int cmd;
printTitle();
while (cin >> cmd)
{
switch (cmd)
{
case 1:
s.pswdChange();
break;
case 2:
viewScore();
break;
case 3:
cout << "Byebye!" << s.name << '!' << endl;
system("pause");
return 0;
default:
cout<<"No such option!\n";
system("pause");
break;
}
printTitle();
}
system("pause");
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。