Objects and Classes ■Exercise2 is invoked to create an object A)A function with a return type B)A constructor C)The main function D)A function with the void return type
n Exercise 2 ________ is invoked to create an object. A) A function with a return type B) A constructor C) The main function D) A function with the void return type Objects and Classes
Objects and Classes Exercise 3 #include <iostream> int main( using namespace std; { Aa; class A a.print(; { public: int s; A(int newS) A)The program compiles and runs fine and prints nothing. B)The program has a compilation error because s=newS; class A is not a public class. } C)The program has a compilation error because class A does not have a default constructor. void print() D)The program would compile and run if you change Aa to Aa(5). cout <s:
n Exercise 3 #include <iostream> using namespace std; class A { public: int s; A(int newS) { s = newS; } void print() { cout << s; } }; Objects and Classes int main() { A a; a.print(); } A) The program compiles and runs fine and prints nothing. B) The program has a compilation error because class A is not a public class. C) The program has a compilation error because class A does not have a default constructor. D) The program would compile and run if you change A a to A a(5)