Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package onlineQuiz;
- import java.util.Scanner;
- import java.util.Random;
- public class OnlineQuiz {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // declare variable
- int totalScore = 0;
- Scanner input = new Scanner(System.in);
- Random rng = new Random();
- QuestionBank qb = new QuestionBank;
- int questionsasked[] = new int[5];
- for (i=0;i<4;i++)
- {
- int nextnumber = rng.nextInt(9);
- boolean repeated = false;
- for (j=0;i<4;i++)
- {
- if(nextnumber == questionsasked[j])
- repeated = true;
- }
- if(!repeated)
- questionasked[i] = nextnumber;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement