[Java] Quiz
I'm looking to create a tree diagram quiz. To start off basically, what is a good approach?
By doing a "do ... while bla" loop so more than one player can enter and then having several variables for different questions. (I haven't looked at arrays yet).
But should I do it like this: question_one = JOptionPane.... "What is your fav colour?"
question_two = .......
Or after each question should I do an "if (question_one.equalsIgnoreCase("blue")) ?
After I've obtained all the answers to the different questions I would need to construct a message. Would I have to do another if statement - for example
if (question_one == blue && question_two == red)
But that approach is very long as I would have to do every possibility for the answers in the comparison. Is there a way I can simply based on one individual answer, come up with a line that links to that answer and then do this for every question and every possibility and for the final output add all these lines together.
If I was to modify all of this to rely on arrays, how would I do so to keep a record of the final decisions of each person who played in an array so that at the end all the decisions can be printed out along with the name of the player (they give their name at the start) or store the questions and answers in arrays at the start and have the main body just pull question text from the array?
Thanks for any help.
__________________
R3: LegioN (came #32) || R4: BlueTuba
R5: WolfPack Order || R6: Wolfpack
R7: Fury
----------retired-------
R52-R55: Apprime
R56-R57: FaceLess
R58-60: Apprime/Ultores
|