Question: For this lab you will create several functions using template parameters A sample main to test your functions has been provided for you have your

For this lab you will create several functions using template parameters A sample main to test your functions has been provided for you have your output to the console AND THE LOG match the runme_example copy the files over as you have done in the previous labs you will complete the functions in "template_functions.h" File: template_functions.h 
#include  #include "cmpslib19.h" #include "easylogging++.h" // here are copies of GetLarger and GetSmaller for datatype char* // you do NOT want to use the operators <,>,== because you will be comparing the pointers const char * GetLarger (const char* a, const char* b) { LOG(INFO) << "Start " << __PRETTY_FUNCTION__ << endl; const char *temp = (strcmp(a,b) <= 0) ? b:a; LOG(INFO) << "End " << __PRETTY_FUNCTION__ << endl; LOG(INFO) << "Returning " << temp << endl; return temp; } const char * GetSmaller (const char* a, const char* b) { LOG(INFO) << "Start " << __PRETTY_FUNCTION__ << endl; const char *temp = (strcmp(a,b) >= 0) ? b: a; LOG(INFO) << "End " << __PRETTY_FUNCTION__ << endl; LOG(INFO) << "Returning " << temp << endl; return temp; } // T GetLarger (T a, T b) // return the larger value a or b // use the > operator to compare a & b // T GetSmaller (T a, T b) // return the smaller value a or b // use the < operator to compare a & b // log the value you will return like the examples // T GetLarger (T a, T b, T c) // return the larger value a,b or c // log the value you will return like the examples // you only need to call the GetLarger for 2 parameters twice , first with a & b then use that result to compare with c // DO NOT USE < or > in this function // we want to use this function to work for ( char * ) or constant c strings too you cant use < or > on them // T GetSmaller (T a, T b, T c) // return the smaller value a,b or c // log the value you will return like the examples // you only need to call the GetSmaller for 2 parameters twice , first with a & b then use that result to compare with c // DO NOT USE < or > in this function // void SwapValues( T & a, T & b) // swap the values in the two parameters passed in // DO NOT use the "swap" function // void PromptForValue ( string message, T & val) // display the text in message // use cin to read a value into val 

This is what the output is supposed to be below I keep getting a makefile error

Testing with type int GetLarger( 2,3) returns 3 GetLarger( 3,2) returns 3

GetLarger( 1,2,3) returns 3 GetLarger( 2,3,1) returns 3 GetLarger( 3,2,1) returns 3

GetSmaller(2,3) returns 2 GetSmaller( 3,2) returns 2

GetSmaller( 1,2,3) returns 1 GetSmaller( 2,3,1) returns 1 GetSmaller( 3,2,1) returns 1

a=100, b=200 SwapValues(a,b); a=200, b=100 SwapValues(a,b); a=100, b=200

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!