Question: C++ Write a program which asks user for a string and then alters the string by doing the following to the string. A * is

C++

Write a program which asks user for a string and then alters the string by doing the following to the string.

A * is inserted BEFORE the 5th character of the string

A $ is inserted AFTER the 10th character of the string

A @ is inserted AFTER the 6th to the last character of the string

Please write two different solutions:

One solution using any of the string modifying functions.

One solution using only the push_back , at functions and length functions.

Each solution will ask the user for the original string and then print out the altered string.

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!