This program can count number of vowels in a sentence but only ifthey are lower
ID: 3614394 • Letter: T
Question
This program can count number of vowels in a sentence but only ifthey are lower case.I don't know how l can make it to also countuppercase vowels.import javax.swing.*;
public class ExamPractise
{
public static void main (String [] geek)
{
String sentence =JOptionPane.showInputDialog("Enter a any sentence");
int countVowels=0;
int countSentences=0;
int countWords=0;
int countCharacters;
for (int i = 0; i <sentence.length(); i++)
{
char c =sentence.charAt(i);
if (c=='a' ||c=='e' || c=='i' || c=='o' || c=='u')
{
countVowels++;
}
}
System.out.println("There are" + " " + countVowels + " " +"vowels");
}
}