Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Arrays;
- public class ArrayQuiz{
- public static void main(String[] args) {
- String [] questions = {
- "Capital of Spain?
- n 1- Madridn 2- Barcelonan 3- Buenos Airesn 4- Caracas",
- "Capital of Irland?
- n 1- Sidneyn 2- Dublinn 3- Edinburgn 4- Manchester"};
- int num = (int) (Math.random() * questions.length);
- System.out.println("First question is nn" + questions[num]);
- int answer=in.nextInt();
- // how to match the right question?
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement