wacky_wadz14
New Member
- Joined
- Oct 1, 2010
- Messages
- 2
The error is "else" without "if". What's the solution for this?
import java.io.*;
public class edward{
public static void main(String args[]) throws Exception{
String a;
int y;
System.out.print("Enter Message: ");
x=input.readLine();
for(y=0; y<A.LENGTH(); p y++){<> if (x.charAt=='a' || x.charAt(y=='A');
System.out.println("*");
else if (x.charAt=='e' || x.charAt(y=='E');
System.out.println("$");
else if (x.charAt=='i' || x.charAt(y=='I');
System.out.println("/");
else if (x.charAt=='o' || x.charAt(y=='O');
System.out.println("+");
else if (x.charAt=='u' || x.charAt(y=='U');
System.out.println("-");
else
System.out.println(x.charAt);
}
}
}
import java.io.*;
public class edward{
public static void main(String args[]) throws Exception{
String a;
int y;
System.out.print("Enter Message: ");
x=input.readLine();
for(y=0; y<A.LENGTH(); p y++){<> if (x.charAt=='a' || x.charAt(y=='A');
System.out.println("*");
else if (x.charAt=='e' || x.charAt(y=='E');
System.out.println("$");
else if (x.charAt=='i' || x.charAt(y=='I');
System.out.println("/");
else if (x.charAt=='o' || x.charAt(y=='O');
System.out.println("+");
else if (x.charAt=='u' || x.charAt(y=='U');
System.out.println("-");
else
System.out.println(x.charAt);
}
}
}