有什么问题啊,为什么没按循环让我输入?
#include <iostream>using namespace std;
class student
{
private:
char name,pj;
float ftext,mtext,rtext1,rtext2,allscore;
public:
void Input();
void Evaluate();
void Output();
student()
{
char pj='B';
}
};
void student::Input()
{
cout<<"请输入学生的姓名"<<endl;
cin>>name;
cout<<"请输入学生两次随堂成绩(0-10),一次期中成绩(0-100)和一次期末成绩(0-100)"<<endl;
cin>>rtext1>>rtext2>>mtext>>ftext;
}
void student::Evaluate()
{
allscore=ftext*0.5+mtext*0.25+(rtext1+rtext2)*0.25;
if(allscore>=90)
pj='A';
else if(allscore>=80&&allscore<=89)
pj='B';
else if(allscore>=70&&allscore<=79)
pj='C';
else if(allscore>=60&&allscore<=69)
pj='D';
else
pj='E';
}
void student::Output()
{
cout<<"学生姓名:"<<name<<" 随堂成绩1和2"<<rtext1<<rtext2<<endl;
cout<<"期中成绩和期末成绩:"<<mtext<<ftext<<endl;
}
int main()
{
student Array[5];
int i;
for(i=0;i<5;i++)
{
Array[i].Input();
Array[i].Evaluate();
}
for(i=0;i<5;i++)
Array[i].Output();
return 0;
}