This lab is about functions. Write the functions below as instructedThe first function is named add and takes two integers as input and returns their sum as an integer.The second function is also...

1 answer below »
This lab is about functions. Write the functions below as instructedThe first function is named add and takes two integers as input and returns their sum as an integer.The second function is also named add and takes two doubles as input and returns their sum as a double.The third function is called multiply. It takes two integers as input and calls the add function you wrote previously over and over again in order to get the product of your two input variables. So for instance, if a user inputs the numbers 3 and 4, the multiply function will run a loop that calls the add function 4 times. The add function will add the previous result and the number three together in each iteration of the loop. This function returns an integer as output.The fourth function is called power. It takes two integers as input and calls the multiply function you wrote previously over and over again in a loop in order to get the power of the inputs. So, just like in the previous function, if the input parameters are 2 and 4, the function will call multiply in a loop 4 times, multiplying the previous result by two each time.The fifth function is called concatenate. It will take two strings as input and return a single string as output of both input strings combined into one.The sixth function is called passByReference. It will pass two integers by reference and increment both of them.The seventh function is called getMood(). It takes a bool as input and returns the string “happy” if the input was true and the string “sad” if the input was false.The eight function should be named impervious and pass a long value as input. The function should add 10 to the input value and return the resulting value.The ninth function is called stat. It should take no parameters as input and return an integer. Inside the function, there should be a static integer variable that gets incremeted and then returned by the function.In your main function you should call each function at least twice to verify that they work as expected. Check the values of your input variables from main before entering the function and after entering the function for each call by printing them to standard output.
Answered 1 days AfterDec 01, 2021

Answer To: This lab is about functions. Write the functions below as instructedThe first function is named add...

Sathishkumar answered on Dec 02 2021
135 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here