Help me with the string program please, urgent.

Hello everyone I'm trying to write a program that changes a vowel in a string input to a number but only one chosen at a time i.e if the input is cream, if I chose a it is going to print cre4m but if I chose e it is going to print cr9am vowel equivalences are
a=>4
e=>9
i=>1
o=>0
u=>5

so I want an output like

Sample Run 1
This is a blab la…

1 - Enter new source text
2 - Change search vowel (current: a)
3 - Exit
Please enter user command number: 1

Please enter the text: cream

Processed output is: cre4m

1 - Enter new source text
2 - Change search vowel (current: a)
3 - Exit
Please enter user command number: 2

Please enter a vowel (a,e,i,o,u): e

1 - Enter new source text
2 - Change search vowel (current: e)
3 - Exit
Please enter user command number: 1

Please enter the text: eclipse

Processed output is: 9clips9

1 - Enter new source text
2 - Change search vowel (current: e)
3 - Exit
Please enter user command number: 3
Bye...
Press any key to continue . . .



I cant figure it out help me please. Thank you in advance

Come up with at least something of your own, I am sure you can write at least some part of the program. When you need help with a specific issue show everything you got and explain what exactly you need help with.
Last edited on
I did write it, but I really dont understand two things, firstly how can I create the while loop of the whole thing which is at the second option I chose some vowel and it returns me to beginning and secondly how can I write a loop that replaces vowels with a number. Thank you

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <iostream>
#include <string>
using namespace std;




int main()
{
	char a, e, i=0, o, u;
	string inputString, vowel, len, s, i=0;
	len = inputString.length();
	int commandNumber;
	cout <<	"1 - Enter new source text \n"
			"2 - Change search vowel (current: a) \n"
			"3 - Exit \n"
			"Please enter user command number: \n";
	cin >> commandNumber;


	for (commandNumber = 1; commandNumber < 3;)
	{
		if (commandNumber == 1)
		{
			cout << "Please enter the text: ";
			cin >> inputString;
			for(i ; i < len;)
			{
			}

		}

	
		else if (commandNumber == 2)
		{
			cout << "Please enter a vowel (a,e,i,o,u): ";
			cin >> vowel;
			unsigned int vowel = 0;
		
			}
		}
		else if (commandNumber == 3)
		{
			cout << "Bye...";
		}
		else
		{
			cout << "Unknown command number... Try again [1,3]"; 
		}


	}
Topic archived. No new replies allowed.