Advertisement
andresnogales

Main4.java

Oct 27th, 2021
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. //Grupo 2.3
  2.  
  3. public class Main4 {
  4.     public static void main(String[] args) {
  5.        
  6.         Integer number;
  7.         FactorizationList factorizationList;
  8.        
  9.         String[] options = {
  10.                 "Ingresar número",
  11.                 "Generar número aleatorio"
  12.                 };
  13.         Menu menu = new Menu(options);
  14.        
  15.         Integer option = 0;
  16.        
  17.         do {
  18.             option = menu.getOption();
  19.            
  20.             switch(option) {
  21.             case 1:
  22.                 number = Helper.getPositiveInt("Ingrese un número positivo: ");
  23.                 factorizationList = new FactorizationList(number);
  24.                 factorizationList.printResult();
  25.                 break;
  26.                    
  27.             case 2:
  28.                 number = Helper.randomInt(1, 1000);
  29.                 factorizationList = new FactorizationList(number);
  30.                 factorizationList.printResult();
  31.                 break;
  32.             }  
  33.             Helper.pressEnterKeyToContinue();
  34.         }while(option != 0);
  35.        
  36.         System.out.println("Fin del programa");
  37.     }
  38.  
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement