C实现简单的学生信息管理系统控制台程序

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
{
using namespace std;
using namespace studentInformation;
int deleteVectorSize = ();
if (deleteVectorSize == 0)
{
cout << "---------------------------------------" << endl;
}
else
{
SearchStudent();
cout << "您想对该学生的信息进行修改吗" << endl;
cout << "按下1:是的。" << endl;
cout << "按下0:放弃修改。" << endl;
cout << "---------------------------------------" << endl;
cout << "当前系统中没有学生信息,请先添加学生信息!" << endl;
cout << "---------------------------------------" << endl;
}
else
{
SearchStudent();
cout << "您想删除该学生的信息吗" << endl;
else
studentVector[i].Student_WriteGradeRank(i + 1);
}
}
}
bool CmpTotalGrade(Student student1, Student student2)
{
return () > (); 样能实现成绩的降序排列
}
void RankByTotalGrade()
}
}
}
tudent_WritePersonalInformation(iD,name,address,phone);
cout << "基本信息输入成功!" << endl
<< "------------------------------" << endl;
}
tudent_WriteMaPhEgGrade(mathGrade, physicsGrade, englishGrade);
{
using namespace studentInformation;
using namespace std;
int rankVectorSize = ();
if (rankVectorSize == 1)
{
studentVector[0].Student_WriteTotalGradeRank(1);
}
else
{
sort(), (), CmpGrade); tudent_ReadTotalGrade() == studentVector[i - 1].Student_ReadTotalGrade()))
studentVector[i].Student_WriteTotalGradeRank(studentVector[i - 1].Student_ReadTotalGradeRank());
}
void SearchStudent()
{
using namespace std;
using namespace studentInformation;
char ID[13];
cout << "请输入学生的学号:"<<endl;
cin >> ID;
();
cout << "------------------------------"<<endl;
}
else
{
cout << "未找到该学生" << endl;
}
}
void ModifyStudentInformation()
{
using namespace std;
using namespace studentInformation;
int searchVectorSize = ();
if (searchVectorSize == 0)
}
else
{
cout << "--------------------------------------------------------" << endl;
coБайду номын сангаасt << "姓名 学号 综合成绩 综合排名" << endl;
for (i = 0; i < displayVectorSize; i++)
int vectorSize = ();
int i = 0;
while ((i<vectorSize) & (flagStudentFound!=0))
{
flagStudentFound = strcmp(ID, studentVector[i].Student_ReadID());
i = i + 1;
}
if (flagStudentFound == 0)
{
flagStudentChoose = i - 1;
flagStudentFound = 1;
cout << "您所查找的学生信息如下:"<<endl;
studentVector[flagStudentChoose].Student_DisplayInformation();
case 5:RankByID(); break;
case 6:cout << "功能暂未实现" << endl; break;
case 7:cout << "功能暂未实现" << endl; break;
case 8:DisplayAllStudentInformation(); break;
case 0:break;
{
case 1:AddStudentPersonalInformation(1); break;
case 2:ModifyStudentInformation(); break;
case 3:DeleteStudentInformation(); break;
case 4:DisplayStudentInformation(); break;
{
std::vector<Student>::iterator iter = () + flagStudentChoose; tudent_DisplayInformation();
}
}
bool CmpGrade(Student student1, Student student2)
{
return () > (); 样能实现成绩的降序排列
}
else
{
sort(), (), CmpGrade); tudent_ReadGrade() == studentVector[i - 1].Student_ReadGrade()))
studentVector[i].Student_WriteGradeRank(studentVector[i - 1].Student_ReadGradeRank());
return true;
else
return false;
}
void RankByID()
{
using namespace studentInformation;
using namespace std;
int rankVectorSize = ();
sort(), (), CmpID);
cout << "-----------------------------------" << endl;
int displayVectorSize = ();
int i;
if (displayVectorSize == 0)
{
cout << "------------------------" << endl;
cout << "当前系统中没有学生信息!" << endl;
cout << "------------------------" << endl;
cout << "按下4:显示学生信息." << endl;
cout << "按下5:按学号升序排序" << endl;
cout << "按下6:读入已有信息(暂时没实现)" << endl;
cout << "按下7:将信息输出(暂时没实现)" << endl;
cout << "按下8:显示系统内所有学生的信息" << endl;
<< endl << endl;
cout << "按下1:进入学生信息管理系统." << endl;
cout << "按下0:退出." << endl;
cout << "-----------------------------------------------------" << endl<<endl<<endl;
cout << "排序成功!" << endl;
cout << "-----------------------------------" << endl;
}
void DisplayAllStudentInformation()
{
using namespace std;
using namespace studentInformation;
int flagModify;
cin >> flagModify;
();
if ((flagModify == 1)&(flagStudentFound == 0))
{
AddStudentPersonalInformation(2);
}
}
}
void DeleteStudentInformation()
}
void RankByGrade()
{
using namespace studentInformation;
using namespace std;
int rankVectorSize = ();
if (rankVectorSize == 1)
{
studentVector[0].Student_WriteGradeRank(1);
cout << "学习成绩输入成功!" << endl
<< "------------------------------" << endl;
}
tudent_WriteOtherGrade(peerGrade, teacherGrade, ethicGrade);
cout << "其他成绩输入成功!" << endl
cout << "按下1:删除。" << endl;
cout << "按下0:取消。" << endl;
cout << "---------------------------------------" << endl;
int flagModify;
cin >> flagModify;
();
if ((flagModify == 1)&(flagStudentFound == 0))
else
studentVector[i].Student_WriteTotalGradeRank(i + 1);
}
}
}
bool CmpID(Student student1, Student student2)
{
int result;
result = strcmp(), ());
if (result<0)
cin >> flagOperateInformation;
();
cout << endl;
if (flagOperateInformation)
EditMenu();
}
}
<< endl;
cout << "按下2:修改学生信息." << endl;
cout << "按下3:删除学生信息." << endl;
cout << "按下0:返回上一级." << endl;
cout << "--------------------------------------------" << endl <<endl;
cin >> flagContinueOperation;
();
cout << endl;
switch (flagContinueOperation)
{
cout << "---------------------------------------" << endl;
cout << "当前系统中没有学生信息,请先添加学生信息!" << endl;
cout << "---------------------------------------" << endl;
<< "------------------------------" << endl;
}
RankByGrade();
RankByTotalGrade();
cout << "学生成绩录入成功!" << endl;
cout << "-------------------------------------" << endl<<endl;
相关文档
最新文档