Question: solve this in c++ with complete detail and comments. 2. No. 1 > a) Write a main function which can define objects on run time

 solve this in c++ with complete detail and comments. 2. No.

solve this in c++ with complete detail and comments.

2. No. 1 > a) Write a main function which can define objects on run time of two different classes, ClassEven and ClassOdd, take input from user, if user inputs an even number the program should define an object of ClassEven and if user inputs an odd number the program should define an object of ClassOdd. (5 Marks) b) Write a function which can determine which object to create when a value is passed to it, it should define an object of class A, B and C, when '1', '2', and '3' is passed respectively Return the address of created object

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!