Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package les;
- import java.util.Scanner;
- public class Switch_Strings
- {
- public static void main(String[] args)
- {
- //switch statment that translatwes names of the seasons in eng to span
- String season;
- Scanner keyboard= new Scanner(System.in);
- System.out.println("enter a season");
- season = keyboard.nextLine();
- season = season.toUpperCase();
- switch(season)
- {
- case"WINTER":
- System.out.println("el invernot");
- break;
- case "SPRING":
- System.out.println("la primavera");
- break;
- case "SUMMER":
- System.out.println("el verano");
- break;
- case "FALL":
- case "AUTUM":
- System.out.println("el otoio");
- break;
- default:
- System.out.println("invalid choice");
- break;
- }
- keyboard.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement