Skip to content

yigaorendanda/-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

-import java.util.Scanner;

public class InputScanner{ public static void main(String[] args){ final String youngsister = "YOUNGER"; final String oldersister = "OLDER"; final String sister = "SECRET";

Scanner scan = new Scanner(System.in);

System.out.println("Please input the age of your sister:"); int age = scan.nextInt();

String nickname = sister;

if(age < 15){ nickname = youngsister; }

if(age >= 15){ nickname = oldersister; }

switch(nickname){ case youngsister: System.out.println("you are young"); break;

case oldersister: System.out.println("you are old"); break;

case sister: System.out.println("it is a secret"); break;

default: System.out.println("Please try again"); }

} }

//HelloWorld.java Public class HelloWorld{ Public static void main(String[]args){ System.out.println(“Hello World”); } }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published