Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

What is the status (prevalence) of unions today?

Answered: 1 week ago