Given the program, which of the following class member accesses are legal?

```
#include using namespace std; class DayOfYear { public: void input(); void output(); int month; int day; }; int main() { DayOfYear birthDay; birthDay.input(); // a) birthDay.day = 25; // b)
cout << birthDay.month; // c)
cout << birthDay.output(); // d)
if(birthDay.month == 1) // e)
cout << "January\n";
}
```

All of them are legal. Everything is pubic now, so any function can access any member .

Computer Science & Information Technology

You might also like to view...

A ________ keeps your computer safe by determining who is trying to access it

A) gateway B) hub C) firewall D) switch

Computer Science & Information Technology

The ________ method returns a string array containing substrings from the string on which it is called.

a) ToArray b) GetSubstrings c) Split d) ToWords e) Divide

Computer Science & Information Technology