Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.Arrays;
  3.  
  4. public class ArrayQuiz{
  5.  
  6. public static void main(String[] args) {
  7.  
  8. String [] questions = {
  9. "Capital of Spain?
  10. n 1- Madridn 2- Barcelonan 3- Buenos Airesn 4- Caracas",
  11.  
  12. "Capital of Irland?
  13.  
  14. n 1- Sidneyn 2- Dublinn 3- Edinburgn 4- Manchester"};
  15.  
  16. int num = (int) (Math.random() * questions.length);
  17.  
  18. System.out.println("First question is nn" + questions[num]);
  19. int answer=in.nextInt();
  20.  
  21. // how to match the right question?
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement