A Sports Club is an organization formed in order to help its members develop interest in certain
sports.
import java.util.Scanner;
public class SportsClub {
public static void main(String[] args){
int i=1;
System.out.println("Available games are listed below");
System.out.println("-----------------------------------");
System.out.println("Enter 1 for Cricket");
System.out.println("Enter 2 for Hockey");
System.out.println("Enter 3 for Football");
System.out.println("Enter 4 for Bollyball");
System.out.println("-----------------------------------");
System.out.println("Please enter the values");
Scanner sc=new Scanner(System.in);
i=sc.nextInt();
switch(i){
case 1:
System.out.println("You have selected cricket");
break;
case 2:
System.out.println("You have selected Hockey");
break;
case 3:
System.out.println("You have selected Football");
case 4:
System.out.println("You have selected Bollyball");
default:
System.out.println("Entered item is not available.");
break;
}
}
}
Comments
Leave a comment