Given the following class and array declaration, how would you print out the age of the 10th person in the array?
Class personClass
{
Public:
Void setAgeint newAge) ;
Void setGender char newGender) ;
Void setSalaryfloat newSalary) ;
Int getAge) ;
Char getGender) ;
Float getSalary) ;
Private:
Int age;
Char gender;
Float salary;
};
PersonClass people[100];
A) cout << people[10];
B) cout << people[9];
C) cout << people[9].age;
D) cout << people[9].getAge) ;
Correct Answer:
Verified
Q46: If obj1 and obj2 are both objects
Q47: Which of the following are not correct?
A)
Q48: Which of the following statements are true?
A)
Q49: Which of the following are valid declarations
Q50: The copy constructor for a class is
Q51: Which of the following operators can not
Q53: Why are the extraction and insertion operators
Q54: Which of the following function declarations would
Q55: What happens when you define a class
Q56: When a dynamic array with a class
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents