Consider the following statements: struct nameType { string first; string last;
ID: 3634821 • Letter: C
Question
Consider the following statements:
struct nameType
{
string first;
string last;
};
struct dataType
{
int month;
int day;
int year;
};
struct personalInfoType
{
nameType name;
int pID;
dateType dob;
};
personalInfoType person;
personalInfoType classlist[100];
nameType student;
Mark the following statements as valid or invalid. If a statement is invalid, explain why.
a. person.name.first = "William";
b. cout << person.name << endl;
c. classList[1] = person;
d. classList[20].pID = 000011100;
e. person = classList[20];
f. student = person.name;
g. cin >> student;
h. for (int j = 0; j < 100; j++)
classlist[j].pID = 00000000;
i. classlist.dob.day = 1;
j. student = name;
Write C++ statements that do the following:
name : Mickey Doe
pID: 111111111
performanceRating: 2
dept: ACCT
salary: 34567.78