Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package drivingage;
- public class DrivingAge {
- public static void main(String[] args) {
- for(int age = 16;age<=99;age+=20){
- System.out.println(age);
- }
- int age = 10;
- if (age >= 16){
- System.out.println("Reached minimum age limit.");
- }else{
- System.out.println("Must wait until you reach the minimum age!");
- }
- switch (age){
- case 10:
- System.out.println("You can not get your drivers license!");
- break;
- case 16:
- System.out.println("You can get your drivers license!");
- break;
- default:
- System.out.println("I don't know how old you are.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement