import java.util.*; public class Millionaire { public static void main(String[] args) { Scanner in=new Scanner(System.in); String[] questions={...}; // put your questions here, of the form "question 1", "question 2", "question 3" char[] answers={...}; // your answers should be multiple choice and one letter per answer, matching the questions array such as 'A', 'C', 'B' char userAnswer; // this will be the answer that the user enters boolean[] used=new boolean[questions.length]; // this array will store which question(s) have already been used // initialize all elements of used to false boolean correct=true; Random g=new Random(); int score=0, value; while(correct) { // get a random number, i, and make sure used[i] is still false // obtain the current question which is questions[i] and set used[i]=true // get the user's answer as a string and then upper case it and make it charAt(0) // if userAnswer equals answers[i] add to the user's score // else set correct=false; which will exit this loop } // output the amount the user wins } // enhancement help: // 1. Add a variable turn set to 0. Increment it when you double amount and output turn. // 2. Change the while loop condition. Use 'E' to allow the user to exit. You can use // 'Q' if you prefer which will change #4 below slightly. // 3. Add int variable lifeline=3. Change the code where the JOptionPane instruction is // to a do-while loop. do { ... } while(answer!='A'&&answer!='B'&&answer!='C'&&answer // !='D'&&answer!='E'); In the ..., input the user's guess. // If userAnswer=='L'&&lifeline>0) then create the new answer and decrement lifeline. // If (userAnswer=='L'&&lifeline==0) then output a warning that they have used all // their lifelines. As this is in a do while loop, they will not be able to get out // of the loop until they guess an actual answer or enter 'E' for exit. // 4. Add another array called amount where amount[level] is the amount the user will win if // they are trying to answer a question of that level. For instance, the amounts might be: 100, 200, 300, 500 // 1000, 2000, 5000, 10000, 20000, 30000, 50000, 100000, 200000, 500000, 1000000 or some variation like that // 5. Separate your questions into 3 question arrays and the answers into 3 answer arrays, easy questions, // medium questions, hard questions. Use the variable turn (from #1 above) to indicate // when to switch from one array to the next. As an alternative, you can use // the original three arrays (questions, answers, used) but make them 2 dimensional // arrays where the second dimension is whether the questions are easy, medium or // hard. To move from one set of questions to the next, increment a variable used // to denote the hardness. For instance, level=0 to start. Ask questions of // questions[i][level], using the answer in answers[i][level] and used[i][level]. // Once the user has answered the easy questions, add 1 to level. }