private int consonantUpper;
private int consonantLower;
for (int i = 0; i < this.str.Length; i++)
if (this.str[i] >= 'A' && this.str[i] <= 'Z')
if (this.str[i] != 'A' && this.str[i] != 'E' && this.str[i] != 'I' && this.str[i] != 'O' && this.str[i] != 'U')
else if (this.str[i] >= 'a' && this.str[i] <= 'z')
if (this.str[i] != 'a' && this.str[i] != 'e' && this.str[i] != 'i' && this.str[i] != 'o' && this.str[i] != 'u')
if (this.str[i] >= 'A' && this.str[i] <= 'Z')
if (this.str[i] == 'A' || this.str[i] == 'E' || this.str[i] == 'I' || this.str[i] == 'O' || this.str[i] == 'U')
else if (this.str[i] >= 'a' && this.str[i] <= 'z')
if (this.str[i] == 'a' || this.str[i] == 'e' || this.str[i] == 'i' || this.str[i] == 'o' || this.str[i] == 'u')
public void setString(string str)
public int getconsonantUpper()
return this.consonantUpper;
public int getconsonantLower()
return this.consonantLower;
public int getvowelUpper()
public int getvowelLower()
public int getvowelCount()
public static void Main(string[] args)
String str = new String();
Console.WriteLine("String input: ");
str.setString(Console.ReadLine());
Console.WriteLine("Uppercase Consonants = " + str.getconsonantUpper() + ".");
Console.WriteLine("Lowercase Consonants = " + str.getconsonantLower() + ".");
Console.WriteLine("Uppercase Vowels = " + str.getvowelUpper() + ".");
Console.WriteLine("Lowercase Vowels = " + str.getvowelLower() + ".");
Console.WriteLine("Number of vowels = " + str.getvowelCount() + ".");