CODE
// By Pragnesh Patel
// Professor John Ryan
// 4/21/08
// Structures
#include <iostream>
#include <string>
using namespace std;
struct typestudent
{
string firstname;
string lastname;
double gpa;
char frequentgrade;
};
int main()
{
typestudent s[5];
int a=0,b=0,c=0,d=0,f=0;
for (int i=0; i<5; i++)
{
cout<<"Please enter a student's name."<<endl;
cin>>s[i] first name;
cout<<"Please enter a student's name."<<endl;
cin>>s[i] last name;
cout<<"Please enter a student's GPA."<<end1;
cin>>s[i]GPA;
cout<<"Please enter a student's final exam grade."<<endl;
cin>>s[i]final;
if(final=='a')
a++;
else if (final=='b')
b++;
else if (final=='c')
c++;
else if (final=='d')
d++;
else if (final=='f')
f++;
}
return 0;
}
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(27) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'struct typestudent' (or there is no acceptable conversion)
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(27) : error C2146: syntax error : missing ';' before identifier 'first'
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(27) : error C2065: 'first' : undeclared identifier
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(27) : error C2146: syntax error : missing ';' before identifier 'name'
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(27) : error C2065: 'name' : undeclared identifier
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(29) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'struct typestudent' (or there is no acceptable conversion)
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(29) : error C2146: syntax error : missing ';' before identifier 'last'
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(29) : error C2065: 'last' : undeclared identifier
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(29) : error C2146: syntax error : missing ';' before identifier 'name'
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(30) : error C2065: 'end1' : undeclared identifier
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(31) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'struct typestudent' (or there is no acceptable conversion)
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(31) : error C2146: syntax error : missing ';' before identifier 'GPA'
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(31) : error C2065: 'GPA' : undeclared identifier
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(33) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'struct typestudent' (or there is no acceptable conversion)
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(33) : error C2146: syntax error : missing ';' before identifier 'final'
C:\Documents and Settings\pp36.ACADEMIC.000\Desktop\structures2\structures2.cpp(33) : error C2065: 'final' : undeclared identifier
Error executing cl.exe.
structures2.exe - 16 error(s), 0 warning(s)