I need a simple C++ program for the following problem, can anyone help?
A string value is to be read in from the keyboard. The string will comprise a name and address with the elements separated by asterisks, such as:
John*Smith*123 The Avenue*Some Town*B91 1NP
The program has to write this string out in the following format.
John Smith
123 The Avenue
Some Town
B91 1NP
The number of elements in the string entry (which will become the number of lines in the written-out format) is not fixed. That is, the number of asterisks in the input string is not known in advance.
You should base your design on first reading in the string to be formatted and then writing out the revised string. Do not attempt to write out the characters as you read them in. Your program should handle whatever input string is received from the user. For example, if the user enters a string with no asterisks included, your program should write out the same string. Every asterisk should produce a new line in the output.