// Program Name: StructArray_2LaX2.exe // Author: Tyler Travis, Eruption Software // www.travis-usa.com // Date: 1/16/00 //This program creates a student structure array, requires //user to input all data, then displays the student's data. #include #define REC_TOTAL 5 #define NAME_TOTAL 25 struct StudentRec { int idNum; int creditHours; char firstName[NAME_TOTAL]; char lastName[NAME_TOTAL]; }; void main() { int x = 0; char answer; StudentRec oneStudent[REC_TOTAL]; cout<<""<>answer; } while (answer == 'y' || answer == 'Y'); } StudentRec get_data(StudentRec oneStudent[REC_TOTAL]) { for(int x = 0; x < REC_TOTAL; ++x) { cout<<" Enter Student #"<>oneStudent[x].firstName; cout<<" Enter Student #"<>oneStudent[x].lastName; cout<<" Enter Student #"<>oneStudent[x].idNum; cout<<" Enter Student #"<>oneStudent[x].creditHours; } return(oneStudent[REC_TOTAL]); } void display_data(StudentRec oneStudent[REC_TOTAL]) { for(int x = 0; x < REC_TOTAL; ++x) { cout<<" Student #"<