63 044
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #38171 in C++ for ephrem moges

Question #38171
develop a c++ program that accepts the name of a person that should replace vowel characters with * in the person name.
Expert's answer
#include <iostream>
#include <string>

using namespace std;

int main ()
{
string Name;
cout<<"Enter name : ";
getline (cin, Name);

for (int i = 0; i < Name.length(); i++)
{
char buf = tolower(Name[i]);
if ( buf == 'a' || buf == 'e' || buf == 'i' || buf == 'o' || buf == 'u' || buf == 'y')
Name[i] = '*';
}
cout <<"After processing : "<< Name;
cin.get (); //wait fo "Enter"
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions