|
|
|
|
|
|
|
SENIOR : cout << Senior << endl;
}
cout << person.gpa << endl;
if (person.sex == M)
cout << Male << endl;
else
cout << Female << endl;
c. PersonType roll[3000];
3. const int NAME_LENGTH =31;
const int MAX_COURSES = 50;
enum YearType {FRESHMAN, SOPHOMORE, JUNIOR, SENIOR};
enum GradeType {A, B, C, D, F, INCOMPLETE};
struct DateType
{
int month;
int year;
};
struct GradeRec
{
int courseID;
GradeType grade;
};
typedef GradeRec GradeArray[MAX_COURSES];
typedef char NameStr[NAME_LENGTH];
struct StudentType
{
NameStr name;
long studentID;
int hoursToDate;
int coursesToDate;
GradeArray courseGrades;
DateType firstEnrolled;
YearType year;
float gpa;
};
10. struct String
{
char str[21];
int length;
};
.
.
.
int StrLength( /* in */ String aString )
{
return aString.length;
} |
|
|
|
|
|