Question: Classes Consider the following C++ program. /l class declaration class thing public -thing0; thing0 thing(int num): int numO: private int number // class implementation thing-thing0
Classes Consider the following C++ program. /l class declaration class thing public -thing0; thing0 thing(int num): int numO: private int number // class implementation thing-thing0 number 0; thing: thing0 number 42; thing::thing( int num) { number= num; } int thing::numOreturn number, void main0 thing red(73); thing green[15] thing blue; int num = 0; (10 points) Which of the following are valid C++ statements that could be compiled and executed in the main function above? (circle valid or invalid). thing yellow( red.num) ): thing purple(red); cout > green.number[7]; num white.numO [valid/ invalid] [valid/ invalid) (valid/ invalid] (valid/ invalid (valid/ invalid valid/invalid [valid/ invalid] [valid/invalid valid /invalid]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
