Advertisement
Guest User

Clase HISTORICO PREGUNTAS (update)

a guest
Nov 29th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.30 KB | None | 0 0
  1. package juego;
  2.  
  3. import java.util.*;
  4.  
  5. /**
  6.  * La siguiente clase almacena una serie de preguntas
  7.  * que se utilizaran a lo largo del juego
  8.  * @author Dibez, Santana
  9.  *
  10.  */
  11. public class HistoricoPreguntas
  12. {
  13.     ArrayList<Pregunta> historico_preguntas = new ArrayList<Pregunta>();
  14.    
  15.     /**
  16.      * Constructor defecto
  17.      */
  18.     public HistoricoPreguntas()
  19.     {      
  20.         this.historico_preguntas.add(new Pregunta("¿Cuántos mundiales de fútbol ganó Argentina?",
  21.                                                   "2",
  22.                                                   "1",
  23.                                                   "4"));
  24.        
  25.         this.historico_preguntas.add(new Pregunta("¿Quién es considerado/a el/la primer/a programador/a?",
  26.                                                   "Ada LOVELACE",
  27.                                                   "Charles BABBAGE",
  28.                                                   "Alan TURING"));
  29.        
  30.         this.historico_preguntas.add(new Pregunta("¿Cuál de los siguientes músico no fue un integrante de 'The Beatles'?",
  31.                                                   "Mick JAGGER",
  32.                                                   "John LENNON",
  33.                                                   "George HARRISON"));
  34.        
  35.         this.historico_preguntas.add(new Pregunta("¿Cuál de los siguientes libros fue escrito por Jorge Luis BORGES?",
  36.                                                   "El Aleph",
  37.                                                   "El Túnel",
  38.                                                   "Rayuela"));
  39.        
  40.         this.historico_preguntas.add(new Pregunta("¿En qué continente se encuentra Japón?",
  41.                                                   "Asia",
  42.                                                   "Oceania",
  43.                                                   "América"));
  44.        
  45.         this.historico_preguntas.add(new Pregunta("¿Quién creó la World Wide Web(WWW)?",
  46.                                                   "Tim Berners-Lee",
  47.                                                   "Steve Jobs",
  48.                                                   "Bill Gates"));
  49.        
  50.         this.historico_preguntas.add(new Pregunta("¿Cuál es el nombre cientifico de las ballenas?",
  51.                                                   "Eschirichtius gibbosus",
  52.                                                   "Stenella dubia",
  53.                                                   "Centruride sp"));
  54.        
  55.         this.historico_preguntas.add(new Pregunta("¿Cuántas cuerdas tiene un laud?",
  56.                                                   "12",
  57.                                                   "6",
  58.                                                   "Ninguna"));
  59.        
  60.         this.historico_preguntas.add(new Pregunta("¿Cuál de estos inventos pertenece a Nikola TESLA?",
  61.                                                   "Corriente Alterna",
  62.                                                   "Telescopio",
  63.                                                   "Pila alcalina"));
  64.  
  65.     }
  66.  
  67.     /**
  68.      * Selecciona de forma aleatoria una pregunta
  69.      * @return la pregunta sorteada
  70.      */
  71.     public Pregunta sortearPregunta()
  72.     {  
  73.         //comienza el algoritmo
  74.         Collections.shuffle(this.historico_preguntas);
  75.         return this.historico_preguntas.get(0);
  76.     }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement