Im a newbie to this .. im having a hard time to solve whats the problem,
#include <iostream>
#include <string>
using namespace std;
int main ()
{
float grade[200];
string name[200];
int circle=0;
int repeat=0;
string display="";
cout<<"Enter number of students:"<<endl;
cin>>circle;
for(repeat=1; repeat<=circle; repeat ++)
{
cout<<"enter a name"<<endl;
cin>>name[repeat];
}
for(repeat=1; repeat<=circle; repeat ++)
{
cout<<"enter " <<name[repeat] <<" grade: "<<endl;
cin>>grade[repeat];
if(grade<=1.9 && grade >=1.0)
{
display= "***";
}
else if(grade<=2.9 && grade >=2.0)
{
display= "**";
}
else if(grade==3.0)
{
display= "*";
}
else{
display = "Invalid Input";
}
}
cout<<"output " << "Remark "<<endl;
for(repeat=1; repeat<=circle; repeat ++)
{
cout<<name[repeat]<< display[repeat]<<endl;
}
return 0;
}
Last edited on