|
| 1 | +package com.lftechnology.assignment; |
| 2 | + |
| 3 | +import java.util.Scanner; |
| 4 | + |
| 5 | +import com.lftechnology.assignment.EvenFibonacciNumbers.EvenFibonacciNumbers; |
| 6 | +import com.lftechnology.assignment.FullNameAndSalutation.FullNameAndSalutation; |
| 7 | +import com.lftechnology.assignment.LargestPalindromeProduct.LargestPalindromeProduct; |
| 8 | +import com.lftechnology.assignment.Multiples.Multiples; |
| 9 | +import com.lftechnology.assignment.guessingNumber.GuessingNumber; |
| 10 | +import com.lftechnology.assignment.printDayInWord.PrintDayInWord; |
| 11 | +import com.lftechnology.assignment.smallestMultiple.SmallestMultiple; |
| 12 | + |
| 13 | +public class Menu { |
| 14 | + |
| 15 | + public static void main(String[] args) { |
| 16 | + Menu.menuList(); |
| 17 | + } |
| 18 | + |
| 19 | + public static void menuList() { |
| 20 | + Scanner input = new Scanner(System.in); |
| 21 | + Menu.list(); |
| 22 | + int pressedOption = input.nextInt(); |
| 23 | + Menu.filter(pressedOption); |
| 24 | + input.close(); |
| 25 | + } |
| 26 | + |
| 27 | + public static void filter(int pressedOption) { |
| 28 | + switch (pressedOption) { |
| 29 | + case 1: |
| 30 | + GuessingNumber.guessingRandomNumber(); |
| 31 | + break; |
| 32 | + case 2: |
| 33 | + PrintDayInWord.printDayInWordProcess(); |
| 34 | + break; |
| 35 | + case 3: |
| 36 | + SmallestMultiple.smallestMultipleProcess(); |
| 37 | + break; |
| 38 | + case 4: |
| 39 | + LargestPalindromeProduct.largestPalindromeProductProcess(); |
| 40 | + break; |
| 41 | + case 5: |
| 42 | + EvenFibonacciNumbers.evenFibonacciNumbersProcess(); |
| 43 | + break; |
| 44 | + case 6: |
| 45 | + Multiples.multipleProcess(); |
| 46 | + break; |
| 47 | + case 7: |
| 48 | + FullNameAndSalutation.fullNameAndSalutationProcess(); |
| 49 | + break; |
| 50 | + case 8: |
| 51 | + System.exit(0); |
| 52 | + break; |
| 53 | + } |
| 54 | + |
| 55 | + Menu.menuList(); |
| 56 | + } |
| 57 | + |
| 58 | + public static void list() { |
| 59 | + System.out.println("\nPress 1 For Guessing number."); |
| 60 | + System.out.println("Press 2 For Print Day in word."); |
| 61 | + System.out.println("Press 3 For Smallest multiple."); |
| 62 | + System.out.println("Press 4 For Largest palindrome product."); |
| 63 | + System.out.println("Press 5 For Even Fibonacci numbers."); |
| 64 | + System.out.println("Press 6 For Multiples of 3 and 5."); |
| 65 | + System.out.println( |
| 66 | + "Press 7 For Create a Hello World Program which takes full name with salutation. Extract salutation and fullname from the argument and display.."); |
| 67 | + System.out.println("Press 8 For Exit."); |
| 68 | + } |
| 69 | +} |
0 commit comments