Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.lang.*;
- class Main
- {
- public static void main (String[] args) throws java.lang.Exception
- {
- for(int age = 16;age<=20;age++){
- System.out.println(age);
- 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;
- case 20:
- System.out.println("you are old enough to drive!");
- default:
- System.out.println("I don't know how old you are.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement