Question: answer in c++ Part A: Array template toolkit. Create a new project. Let's use the array arr below as our example: 1. Define the template

answer in c++
answer in c++ Part A: Array template toolkit. Create a new project.

Part A: Array template toolkit. Create a new project. Let's use the array arr below as our example: 1. Define the template function template T ? int count exact(tald, int site, T find) that returns the number of times find occurs in a. For instance, count exact(arr, 6, 2) would retum 3. Test your function in your main0 using an array of ints, and an arroy of strings. Write a comment explaining which operations the type T needs to support for your code to work. Copy your code into your lab report. Be sure to Bet your work approved before moving on. 2. Define the template function template ctypename T? int count range(T a[d, int size. Tlow, Thigh) that returns the number of times an item whose value is between low and high inclusivel occurs in a. For instance, count rangelarr, 6 . 2 , 4) wodid return 4 . Test your function in your maind. Write a comment explaining which operations the type T needs to support for your code to work. Test your function in your main using an array of ints, and an orray of strins. Copy your code into your lab report. Be sure to get your work approved before moving on

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!