const int amt = 20;
struct student
{
string firstName;
string lastName;
string add;
int id;
};
struct classRecord
{
string courseName;
string teacher;
string school;
int numMale;
int numFemale;
student myStudent[20];
classRecord() // my default constructor
{
courseName = "CPTR 151";
teacher = "Mr. Hunte";
school = "USC";
numMale = 10;
numFemale = 1;
}
void printStudent(student classA[])
{
int x;
for(x = 0; x < 20; x++)
{
cout<<myStudent[x].firstName<<myStudent[x].lastName<<myStudent[x].add<<myStudent[x].id;
}//end for
}// end void
};
//declare variable
student mystudent[20] ={""};
//declare main
int main()
{
string alpha[amt];
int a;
for(a =0; a < 20; a++)
{
cout<<"Enter your first name: ";
cin>>mystudent[a].firstName;
cout<<"Enter your last name: ";
cin>>mystudent[a].lastName;
cout<<"Enter your Address: ";
cin>>mystudent[a].add;
cout<<"Enter your school Id: ";
cin>>mystudent[a].id;
cout<<endl<<endl;
cout<<"*********************************";
cout<<endl<<endl;
}
//declare function
printStudent(alpha);