1.
Which of the following are compound values?
struct Student {
string firstName, lastName;
int year;
double gpa;
};
struct Professor {
string firstName, lastName;
string department;
int class;
};
int main() {
Student x = { "John", "Doe", 2, 3.46 };
Student y = { "Jane", "Doe", 3, 3.68 };
Professor z = { "Richard", "Roe", "Computer Science", 101 };
string college = "University of College";
int studentPop = 3400;
double avgGPA = 3.2;
}
x
x
is aStudent
which is astruct
.y
y
is aStudent
which is astruct
.z
z
is aProfessor
which is astruct
.college
college
is astring
which is made up of characters.studentPop
- An
int
is not a compound value. avgGPA
- A
double
is not a compound value.