Question: PLEASE PROVIDE FULL CODE, AND TWO SEPARATE ANSWERS FOR PAIR.H and HW6.CPP. PLEASE INCLUDE HEADER FILE PAIR.H IN HW6.CPP, BUT ALSO PROVIDE SEPARATELY. Please implement

 PLEASE PROVIDE FULL CODE, AND TWO SEPARATE ANSWERS FOR PAIR.H andPLEASE PROVIDE FULL CODE, AND TWO SEPARATE ANSWERS FOR PAIR.H and HW6.CPP. PLEASE INCLUDE HEADER FILE PAIR.H IN HW6.CPP, BUT ALSO PROVIDE SEPARATELY.

Please implement the class in which includes the private member and Implement the member function that returns a pair consisting of the sum of the first and second element of the pair, and the difference of those elements. For example, if the input is 3 and 4 , then the output should be 7 and 1. If the input is 4 and 3 , then the output should be 7 and 1 The elements could be int, and (So you need to use template class). If the first and second elements are string variables. Then define the sum of them to be the concatenation of them, and define the difference of them to be an empty string variable. For example, if the input is "ab" and "cd", then the output is "abcd" and "". hint: You need to handle this special case with the template specialization. Please don't add the following statement in the header file Remark: without this statement, you may need to modify your code. For example, you need to change to and change to In the file "HW6.cpp", please include the header file "pair.h" and the main function. The first part in function is given as follows. You need to identify the extra member functions in the class and their function signatures based on this snippet. After this part, please add a cout statement to display the date, your name, or the name of all group members if you use group submission. Run your code and save the screenshots of the console. Please upload "pair.h", "HW6.cpp" and screenshots here

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!