Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ program all in main.cpp, thank you! For this assignment you will write several functions in a multiply - takes two integer parameters and returns

C++ program all in main.cpp, thank you! image text in transcribed
image text in transcribed
For this assignment you will write several functions in a multiply - takes two integer parameters and returns the product of the two values given. multiply2 takes three integer parameters. The first two parameters are passed by value and the third parameter is passed by reference. When multipIy2 is finished, the third parameter contains the product of the first two parameters. addMultiple - takes zero to 5 integers and returns the sum of all the integers. You should have one function called addMultiple, not 6 different versions. Bigger takes two parameters of any type and returns the larger one. The parameters can be int or double. You have to use Templates to handle multiple data types, not write two versions of the same function. Changed 11/8, you do not handle strings. Test case below changed as well. fam eome eerlier in the dietione ry. isPalindrome - takes a string parameter and returns true if the given string is a palindrome. For a string, say called str, you can access its characters using str[0], str [1, str [21, and so on. The size of the string is given by str.size,so the last character in the string is stristr.size) 1 since the character index starts from zero. drome takes a string parameter and returns a palindrome made from the string. If makePalin the string is already a palindrome, a copy is returned. Otherwise, letters are added to a copy of the string to make it into a palindrome. To add a single character to a string,say called str, you would use str 'a' or if the character was stored in another string, you'd use str otherString[5]. You only have to handle the simple case for turning strings into palindromes. See examples below for clarification. A sample test function and its output is provided below to help you design and test your functions. void test) int x x -multiply (10, 5) assert (x 50); multiply2 (2, 3, x)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago