当前位置:首页 > 高校水电费管理系课程设计
void Student::output() { }
//学生信息输出函数
cout << \姓名:\\
<< \性别:\\<< \年龄:\
cout << \班级:\
<< \学号:\\<< \用水量:\
\
cout << \用电量:\
<< \水费:\<< \电费:\<< endl << endl;
\
void Student_message::add() {
if (amount >= capacity) { }
Student stud;
//学生信息添加函数
cout << \警告!用户已满!\return;
cout << \请输入添加人员的信息\stud.input();
共 58 页 第 20 页
}
for (int i = 0; i < amount; i++)
if (stud.getnumber() == stu[i].getnumber()) { }
cout << \该编号人员已存在!\return;
stu[amount] = stud; amount = amount + 1;
cout << \添加成功!\
void Student_message::search() {
if (amount == 0) { }
int choice;
//学生信息查询函数
cout << \当前没有人员记录!\return;
cout << \请选择查询方式:1.编号查找 2.姓名查找 3.用水量查找 4.用电
量查找\ cin >> choice; switch (choice) { case 1: { 共 58 页 第 21 页
cout << \请输入要查询的编号:\int number; cin >> number; cout << \姓名\\
<< \性别\<< \年龄\<< \班级\
\\\
<< \学号\<< \用水量\<< \用电量\<< \水费\<< \电费\<< endl << endl;
for (int i = 0; i < amount; i++) { } return;
cout << \此人不存在!\
if (stu[i].getnumber() == number) { }
stu[i].output();
}break;
共 58 页 第 22 页
case 2: {
cout << \请输入要查询的姓名:\string name; cin >> name;
cout << \姓名\\
<< \性别\<< \年龄\<< \班级\
\\\
<< \学号\<< \用水量\<< \用电量\<< \水费\<< \电费\<< endl << endl;
for (int i = 0; i < amount; i++) { } return;
cout << \此人不存在!\
if (stu[i].getname() == name) { }
stu[i].output();
共 58 页 第 23 页
共分享92篇相关文档