Question: using c++ create template funtion and class 2. Develop a template function bigger(). The function takes two parameters of any data type that can be

2. Develop a template function bigger(). The function takes two parameters of any data type that can be compared using ">" operator. The function returns the bigger value. (20 points) 3. Develop a template class box. (40 points) 3a. The box class has a private array data[50] that can hold any data type. 3b. The box class has a private integer variable count, which is used to record how many values are in the box. 3c. There is a method (function) add(). It can add a value into the array. 3d. There is a constructor. It will make the box an empty box to start with. 3e. There is a bool function empty. It will return true if there is nothing in the box. It will return false otherwise. 4. Develop a main() function: (30 points) 4a. Ask the user to enter two names (such as Bob and Helen). Display the bigger one using the bigger() function. 4b. Ask the user to enter two double values (such as 3.14 and 5.24). Display the bigger one using the bigger() function. 3d. There is a constructor. It will make the box an empty box to start with. 3e. There is a bool function empty. It will return true if there is nothing in the box. It will return false otherwise. 4. Develop a main() function: (30 points) 4a. Ask the user to enter two names (such as Bob and Helen). Display the bigger one using the bigger() function. 4b. Ask the user to enter two double values (such as 3.14 and 5.24). Display the bigger one using the bigger() function. 4c. Create a box object strbox, that can handle strings. 4d. Create a box object intbox, that can handle integers. 4e. Put a string into strbox. (any value you want) 4f. Display whether the strbox is empty using the empty() method. 4g. Display whether the intbox is empty using the empty() method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
