Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * KK KK JJJJJJJJJJ BBBBBBBB
- * KK KK JJ BB BB
- * KKKK JJ BBBBBBBB
- * KK KK JJ JJ BB BB
- * KK KK JJJJJJ BBBBBBBBBB
- *
- * Copyright 2018 Jordy Van Kerkvoorde
- */
- package domein;
- import java.security.SecureRandom;
- import java.util.Arrays;
- /**
- *
- * @author KeeJayBe
- */
- public class EuroMillionsApplicatie {
- public static void main(String[] args) {
- int[] cijfers = new int[5];
- int[] sterren = new int[2];
- String[] sterrenbeeld={
- "Ram", "Leeuw", "Boogschutter", "Stier",
- "Maagd", "Steenbok", "Tweelingen", "Weegschaal",
- "Waterman", "Kreeft", "Schorpioen", "Vissen"
- };
- SecureRandom random = new SecureRandom();
- cijfers[0]= random.nextInt(51)+1;
- int i = 1;
- while(i<=4){
- cijfers[i]=random.nextInt(51)+1;
- boolean check = true;
- for(int j=0; j<i;j++){
- if(cijfers[j]==cijfers[i]){
- check = false;
- }
- }
- if(check==true){
- i++;
- }
- }
- Arrays.sort(cijfers);
- System.out.println("De cijfers zijn " + Arrays.toString(cijfers));
- sterren[0]= random.nextInt(11)+1;
- sterren[1]= random.nextInt(11)+1;
- boolean sterCheck = false;
- while(!sterCheck){
- if(sterren[0]==sterren[1]){
- sterren[1]= random.nextInt(11)+1;
- }else{
- sterCheck = true;
- }
- }
- Arrays.sort(sterren);
- System.out.println("De cijfers zijn " + Arrays.toString(sterren));
- int rand = random.nextInt(11) + 1;
- System.out.println("Het sterrenbeeld = " + sterrenbeeld[rand]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement