Question: in c plus Complete template class Pair by defining the following methods: void Input ( ) Read two values from input and initialize the data
in c plus Complete template class Pair by defining the following methods:
void Input
Read two values from input and initialize the data members with the values in the order in which they appear
void Output
Output the Pair in the format firstVal secondVal
char CompareWithPair otherPair
Return the character or according to whether the Pair is less than, equal to or greater than otherPair
Precedence of comparisons is firstVal then secondVal
char ShowComparisonPair otherPair
Compare with otherPair by calling CompareWith
Output the two Pairs separated by the character returned by CompareWith Hint: Output each Pair using Output
Note: For each type main calls Input twice to create two Pairs of that type.
Ex: If the input for two Integer Pairs is:
the first Pair is and the second Pair is
Ex: If the input of the program is:
one two three four
the output is:
one twothree four
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
