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 setAge(int newAge);
void setGender( char newGender);
void setSalary(float 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();
d. cout << people[9].getAge();
You might also like to view...
The two most commonly used personal computers are categorized by their operating system, either ________.
a. Windows or Mac b. Windows or Linux c. Mac or IBM d. Dell or IBM
You can modify data within a field using Backspace, Delete, and typing keys. To complete the modification you should press the _____ key.
A. Ctrl + Shift B. Esc C. Enter D. Shift + Enter