Package Ericsson.Loteria

Source Code of Ericsson.Loteria.Primitiva

package Ericsson.Loteria;

import Ericsson.Loteria.model.Billete;
import java.util.ArrayList;
import java.util.Scanner;


/**
*
* @author beca2012
*/
public class Primitiva {
    private ArrayList<Billete> billetes;
    private Scanner entrada;

    public Primitiva() {
        billetes = new ArrayList<Billete>();
        entrada = new Scanner(System.in);
    }
   
    public static void main(String[] args) {
        Primitiva programa = new Primitiva();
        programa.run();
    }
   
    public void run() {
        recibirPeticionesCreacion();
        mostrarDatos();
    }
   
    private void recibirPeticionesCreacion() {
        System.out.println("Creacion Billetes de la Lotería");
        int opcion = 0;
       
        do {
            Billete billete = new Billete();
            billete.generarCombinacion();
            this.billetes.add(billete);
           
            System.out.println("¿Deseas crear otro billete? (SI = 1) (NO = 0)");
            opcion = entrada.nextInt();
        } while(opcion == 1);
    }
   
    private void mostrarDatos() {
        for(Billete billete : billetes) {
            System.out.println("\n"+billete);
        }
    }
   
}
TOP

Related Classes of Ericsson.Loteria.Primitiva

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.