这个怎么完善呀?求大佬解答
#pragma once;#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
vector<Student>v;
class Student{
public:
string name;
float c_s;
float cpp_s;
float math_s;
double sum;
void caculateSum()
{
sum=c_s*0.3+cpp_s*0.4+math_s*0.3;
}
};
void add_one_student(){
Student s;
cout<<"请依次输入姓名、C语言成绩、C++成绩、高数成绩"<<endl;
cin>>s.name>>s.c_s>>s.cpp_s>>s.math_s;
s.caculateSum();
v.push_back(s);
}
void show_all_student(){
for(int i=0;i<v.size();i++){
cout<<v[i].name<<"\t"<<v[i].c_s<<"\t"<<v[i].cpp_s
<<"\t"<<v[i].math_s<<"\t"<<v[i].sum<<endl;
}
}
int main(){
cout<<"欢迎使用班级成绩管理小程序\n";
while(true){
cout<<"\n【1】查看所有成绩\n【2】查看某一名学生成绩\n";
cout<<"【3】修改某一名学生成绩\n【4】增加某一名学生成绩\n";
cout<<"【5】删除某一名学生成绩\n【6】退出小程序\n";
int select;
Student s;
cout<<"请输入您的选择:";
cin>>select;
switch(select){
case 1:show_all_student();break;
case 2:break;
case 3:break;
case 4:add_one_student();break;
case 5:break;
case 6:return 0;
default:cout<<"对不起,您的输入有误!\n";break;
}
}
return 0;
}