Question: Using C++ Write a program that converts an English phrase to Obenglobish language. An English phrase can be translated to Obenglobish by adding letters ob
Using C++
Write a program that converts an English phrase to Obenglobish language. An English phrase can be translated to Obenglobish by adding letters ob before the vowels (a, e, i, o, and u) in the English phrase. Care must be taken to only add ob before vowels that are non-silent. This rule is difficult to implement in practice; however, we use the following rules to get this effect. ob is not added before:
Vowels that follow other vowels; and An e that occurs at the end of the word.
Complete and submit the following file named obenglobish.cpp
#include
#include
using namespace std;
string obenglobish(const string& english) { // TO DO
return english; }
1
int main() {
while (true) { string word = getLine("Enter a word: "); if (word == "") break;
string trans = obenglobish(word);
cout << word << " -> " << trans << endl; }
return 0; }
Compilation:
$ g++ obenglobish.cpp -o obenglobish
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
