Question: Please help with this! The purpose of this assignment is to practice the strings and functions in C++. Create a C++ programs and name it

Please help with this!

The purpose of this assignment is to practice the strings and functions in C++. Create a C++ programs and name it with the following name format: YourNameAssign03.cpp. Example: If your name is Smith John (last name first), then your C++programs should be: SmithJohnAssign03.cpp.

This program will contain a C++ main function and 4 additional C++ functions as follows:

fullSwap function This function will receive a string and it will swap consecutive characters in the input string. For example, if the input string has 2 or 3 characters, the function will swap the first with the second character, if the input string has 4 or 5 characters, the function will swap the first with the second character and the third with the fourth character, and so on. At the end of the function, it will return the modified string. If the string has less than 2 characters, a message will be printed to that effect and the input string will be returned unchanged.

halfTranspose function

This function will receive a string and it will invert its second half. This will mean for example that if the input string is 12345678, then the output string will be 12348765. If the input string has an odd number of characters, only the middle character is considered to be in the second half. For example, the input string 1234567 will produce 1237654 as the output string

fullTranspose function

This function is similar to halfTranspose, but it will invert both, the first and the second half of the input string. For example, if the input string is 12345678, then the output string will be 43218765. If the input string has an odd number of characters, only the middle character is considered to be in the second half. For example, the input string 1234567 will produce 3217654 as the output string

invadedBy function

This function will receive a string and it will return the same string, but with the students initials inserted in between each character. For example, if the input is ABC, and the students initials are XY, this function will return the string AXYBXYCXY.

main function

This function will show the user what each of the previous method does using the students full name (first name, space, last name) as the input string for the other methods. The output should have appropriate labels that describe which function was used when. Then the program will ask for a string from the user. It will apply again all these methods to the users input and print their results with appropriate labels.

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!