跪求一个C++程序,是一个类似于教务系统的。发我邮箱是1269289500@qq.com,谢谢各位了~~ 具体要求如下:

2024-11-17 07:28:03
推荐回答(1个)
回答1:

#include
using namespace std;
struct Student
{
int id;char name[40];
double math;double chinese;
double sum;double average;
};
Student s[100];//定义结构数组
int total;//当前学生实际人数,S是total的全局变量
void display()
{
for(int i=0;i cout< < < <}
int menu
{
//显示菜单选项
cout<<"1.input\n";
cout<<"2.display\n";
cout<<"3.insert\n";
cout<<"4.search\n";
cout<<"5.edit\n";
cout<<"6.delete\n";
cout<<"7.exit\n";
cout<<"please input n :";
cin>>n;
return n;
}
void input()//输入学生信息
{
int i;//当前输入的学生下标
char x;
do{i=total;
cin>>s[i].id;
cout<<"input id:";
cin>>s[i].name;
cout<<"input name:";
cin>>s[i].mach;
cout<<"input math:";
cin>>s[i].chinese;
cout<<"input chinese:";
total++;
cout<<"are you continue?(Y/N)";
cin>>x;
}while(x=='Y'||x=='y');

}
int main()
{
int select;//选项菜单的编号
while(1)
{
select=menu();
switch (select)
{
case 1:input();break;
case 2:display();break;
case 3:insert();break;
case 4:search();break;
case 5:edit();break;
case 6:delete();break;
case 7:exit();break;
}
}
system("pause");
return 0;
}
你看这个可以么……