I have to write a program which is based on the speeding penalties of UK. So if a driver could be disqualified from driving if s/he builds up 12 or more penalty points within a period of 3 years and if s/he is still within 2 years of passing his/her driving test, his/her driving licence will be revoked (withdrawn) if he/she builds up 6 or more penalty points.
Here is my program:
package lesson1;
import java.util.*;
public class MyClass{
public static void main(String[] args) {
Scanner sc=new Scanner (System.in);
speeding_penalties(13,2);
}
public static void speeding_penalties(int points, int years){
if((points=>12)&& (years<=3)){
System.out.println("disqualified");
}
else if((points=>6)&& (years<=2)){
System.out.println("revoked driving license");
}
}
}
The problem is that I am getting an error at the if
statements which says "The operator && is undefined for arguments type(s) int, boolean".
Aucun commentaire:
Enregistrer un commentaire