+ 1
How to create a table of questions and answers in order of points scored for a quiz in Java?
I have a movie quiz in Java that has arrays, Abstraction Data Types, loops within loops, and keeps score for correct answers. Is it possible to create a table of the questions and corresponding right answers in order of points scored for a quiz in Java so the quiz taker can review? Not sure how to implement. Still new to programming btw, only been coding 2 months âșïž
6 Answers
+ 5
Moe Totally worth it :)
+ 4
You could use a TreeMap that contains a HashMap<String, String> entry (Strings for the questions and answers) and the corresponding Integer or Float for the points.
So you need two Maps, e.g.
HashMap<String, String> quiz;
TreeMap<Integer, HashMap> results; // can be ordered by key
Something like that ;)
+ 3
Roneel just in order of correct answers and wrong answers at the bottom. time is not taken into account.
+ 3
Tashi N Hmmm never done that before, will Google it lol. Thanks.
+ 2
I can't understand sorting in order to points scored for a quiz.
Means for each quiz, there can be different points based on time taken?
+ 2
Still can't get my head into it.đ€
If only correct and wrong, only two possibility and sorting will be just like dividing into two parts-correct and wrong.
Anyway, I am going to study now. Maybe give it a shot tomorrow.