dimanche 20 juin 2021

My current if statement with the logical II OR is having compile error [closed]

I am learning Java and following code is not working, can you please check and see what I did wrong? Thanks.

public class HelloWorld{

    public static void main(String []args){
        /*
         Ticket price: 10 normally

        Discounted price , 5 for:
        - Age 15 and under
        - Over the age 60
        - Students
        */
        int ticketPrice = 10;
        int age = 16;
        boolean isStudent = false;
        
        if( (age =< 15) || (age>60) ){
            ticketPrice = 5;
        }else if (isStudent){
            ticketPrice = 5;
        }
        System.out.println("The price is: "+ ticketPrice);
     }
}

Aucun commentaire:

Enregistrer un commentaire