0
How do in fix the errors?(In the output)
4 odpowiedzi
+ 4
It's always good to review some lessons
https://www.sololearn.com/learn/Java/2143/?ref=app
Also you are missing some { } brackets.
Using a proper indentation in your code will help you find them
+ 1
1. = inside if condition must be ==
2. =< does’t exists. It shoud be <=
3. You missed { after else if condition
4. You missed } at the end
Hope this helps.
+ 1
public class Program {
public static void main(String[] args) {
int age = 12;
boolean IDcard = false;
if (IDcard == true && age >= 18) {
System.out.println("You can go in area A");
} else if (IDcard == false && age <= 13) {
System.out.println("You can go in area B");
} else {
System.out.println("You can go in area C");
}
}
}
0
Thanks guys