Answer to Question #188180 in Java | JSP | JSF for Ahmed Talaat

Question #188180

A Sports Club is an organization formed in order to help its members develop interest in certain

sports.


1
Expert's answer
2021-05-02T23:45:50-0400
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;
        }
        
    }

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS