Question: C++ Replicate a switch statement using Function pointers. Please provide all files and comment as best as you can. Will rate thumbs up if runs

C++ Replicate a switch statement using Function pointers. Please provide all files and comment as best as you can. Will rate thumbs up if runs properly. C++ Replicate a switch statement using Function pointers. Please provide all files

1. Create a function that "mimics" the effect of a switch statement, but can also handle any input. Meaning that the switch statement can only work with integers or characters. Yours will work with integers, characters, strings, etc. 2. Make a class called mySwitch that will perform the functionality of a switch statement. The constructor of the class will allow for N parameters. The parameters will be the "condition" and then the address of which static function in the program to call. Hint: Would templates help you with this since any "condition" must be handled? What tools have we that can handle "infinite" input values?)

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!