Question: Create a C + + file with the name problem 2 . cpp . Write the function swapFirstLetters, which takes two strings as parameters, permanently

Create a C++ file with the name problem2.cpp.
Write the function swapFirstLetters, which takes two strings as parameters, permanently swapping the first character of the two strings.
Write the function longestString, which takes two strings as parameters, printing the longer string and returning the length of the longer string. If both strings are of equal length, then use either string.
Write the function repeatHello, which takes an integer as a parameter, printing the string Hello the number of times equal to the parameter.
Write the main function that does the following:
Prompt the user for their first name and last name.
Call the function swapFirstLetters, passing into it those two strings.
Print the two modified names.
Call the function longestString, passing into it those two strings.
Call the function repeatHello, passing into it the length returned by longestString.

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 Programming Questions!