Question
(C++) A fifth-grade student wants to add three variable types. Given three integer numbers, she would like to know the sum of the three integers
(C++) A fifth-grade student wants to add three variable types. Given three integer numbers, she would like to know the sum of the three integers (which is an integer). Given three double numbers, she would like to know the sum of the three double numbers (which will be a double). And finally, given three string words/letters, she will like the three words to be appended together. Use your C++ programming skills to help this fifth grader to meet her needs as follows.
(a) Write a program that uses a function template called add to determine the sum of the integers and doubles, as well as the appended strings. Test the program in a separate file called Practice_2_Question_11.cpp using integer, floating-point number and string arguments. [Note that the function template and the test program are in two separate files]
(b) Inside the same Practice_2_Question_11.cpp from (a), address the fifth graders problem using function overloading technique.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started