Question: swapperclass.cpp #include using namespace std; class my_class { int x; int y; public: my_class(int a, int b); void swapper(); void printem(); }; my_class::my_class(int a, int

swapperclass.cpp
#includeusing namespace std; class my_class { int x; int y; public: my_class(int a, int b); void swapper(); void printem(); }; my_class::my_class(int a, int b) { x = a; y = b; } void my_class::swapper() { int TempVal = x; x = y; y = TempVal; } void my_class::printem(){ cout Part 2--Class Templates Download the following file. The file: swapperclass.cpp swapperclass. cpp contains a class and implementation for swapping two integer values Your primary task for this exercise is: 1. Create a class template which will swap two values of any type and print them. Steps include: o Implement your code in three files: swapper. cpp, swapper. h, main.cpp. The purpose for this is to see the problem that occurs when using Visual Studio with templates. See Section 6 (below). o Your class should be capable of initializing two data members o Your class should have a function for swapping the two data members. o Your class should also have a function for printing the two data members. o Try different types so that your program can handle int char double . Your output may look similar to the output from
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
