// Replace Vowels and Consonants.
// Date 09/10/2018
// By Ben

#include <iostream>

using namespace std;
using std::cout;
using std::endl;
using std::cin;

void replaceVowelsConsonants(string &source){
	int i = 0;

	//Loop to the end of the string
	while (i < source.length()){
		//Convert all chars to uppercase and check for vowels
		switch (toupper(source[i]))
		{
		case 'A':
		case 'E':
		case 'I':
		case 'O':
		case 'U':
			//Replace vowels width a star
			source[i] = '*';
			break;
		default:
			//Replace consonants with a hash
			if (isalpha(source[i])){
				source[i] = '#';
			}
			break;
		}
		//INC counter
		i++;
	}
}

int main(int argc, char *argv[]){
	string s0 = "http://www.google.com";
	int v, c;
	std::cout << "Input string: " << s0.c_str() << endl;
	//Replace vowels and consonants.
	replaceVowelsConsonants(s0);
	//Output new string
	std::cout << "Output string: " << s0.c_str() << endl;
	system("pause");
	return 0;
}