Question: In c++ Code provided #include #include using namespace std; // Write the timesTwo function template here. // // // // // // int main() {

In c++
Code provided
#include  #include  using namespace std; // Write the timesTwo function template here. // // // // // // int main() { double prices[5] = { 150.00, 200.00, 345.00, 999.99, 44.00}; string animal[5] = { "Dog", "Cat", "Wolf", "Lion", "Fox" }; timesTwo(prices, 5); timesTwo(animal, 5); return 0; };
 In c++ Code provided #include #include using namespace std; // Write

The following short main function for Question 2 is provided on Canvas int main() double prices[5]150.ee, 200.00, 345.00, 999.99, 44.0); string animal[5] { -Dog", "Cat", "Wolf", "Lion", "Fox" }; = timesTwo(prices, 5); timesTwo(animal, 5) return e; )i Notice that the first timesTwo function call passes an array of type double and the size of the array. The second timesTwo function call passes an array of type string and the size of the array Instead of writing two functions, write a function template, so the same single timesTwo function can process and print both types. The string output will be concatenated with itself, and the double output will be each value plus itself Sample Output: Select CAUsers jlatel Source Repos Lab14.q2 DebuglLab14.q2exe 300 90 1999.98 Dog atCat lfWolf ionLion oxFox

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!