HI HOW'S EVERYBODY DOIN?
I AM WORKING ON THIS CODE, THERE ARE SOME ERROR PLS HELP ME FIX THESE.
THE PROGRAM SUPPOSE TO DO.
1. Ask the user to type in a sentence, using a JOptionPane.showInputDialog().
2. The program will scan the
string and count how many upper-case letters appear, and how many
lower-case letters appear.
3. Tell the user how many upper/lower case letters there were using a
JOptionPane.showMessageDialog()
4. Repeat this process until the user types the
word "Stop".
here's the program
public class project {
public static void main (String [] args)
{
String sentece = JOptionPane.showinputDialog ( "Please enter a sentence.")
While (! line.equals ("STOP")
System.out.println("Your string contains "
+ lowercaseLCVowelCount(line)
+ " Number of lower case letters:");
System.out.println("Your string contains "
+ uppercaseLCVowelCount(line)
+ " Number of lower case letters");
System.exit(0);
}
public static int lowercasepro(String text)
{
int count = 0;
for ( int i = 0; i < text.length(); i++ )
{
char x = text.charAt(i);
if ( x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u'
)
count++;
}
public static int uppercasepro(String text)
{
int count = 0;
for ( int i = 0; i < text.length(); i++ )
{
char x = text.charAt(i);
if ( x == 'A' || x == 'E' || x == 'I' || x == 'O' || x == 'U'
)
count++;
return count;
}
}