Advertisement
Guest User

Untitled

a guest
May 27th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. public class Quiz_Fragen {
  2.       int zufall;
  3.       String fragen[] = new String[19];// Arrey von Fragen
  4.       static String frage;
  5.      
  6.    public Quiz_Fragen(){
  7.         fragen[1] = "Was hat bababa?$Me$Jura$li$nichts$Jura";
  8.          fragen[2] = "Was hat bababa?$Me$Jura$li$nichts$Jura";
  9.      fragen[3] = "Was hat ccc?$ccc$ddd$eee$fff$eee";
  10.      fragen[4] = "Was hat aaa?$aaa$sss$sss$fff$sss";
  11.      fragen[5] = "Was hat hpbbit?$Me$Jura$li$nichts$Jura";
  12.     frage = fragen[zufall(1,6)];              //ändern wenn mehr fragen
  13.      }                              
  14.    public int zufall (int min, int max){
  15.     zufall = (int)((max-min)*Math.random()+min);              //Mathematischer logarithmus
  16.    
  17.     return zufall;
  18.      }
  19.          
  20. } // end of class Quiz_Fragen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement