lundi 8 janvier 2018

Math quiz toggling random numbers to ordered.

For a school project I'm expected to create a math quiz application. I'll be using Java Swing for this. This application has things such as a difficulty level based on grade, options to select an amount of questions the users wants to handle, and the option to generate those math questions randomly or in order.

The first two items aren't going to be an issue. However, the last item is proving to be more challenging than I expected. I'll elaborate on that item now. Essentially I should be able to toggle whether the math questions are generated randomly or in order prior to starting the quiz. However, I'm not quite sure how to tackle this, and I was wondering if someone more experienced (as I am still a beginner) could help me out.

My main question here is a theoretical one but a practical example (for a visual understanding) would be appreciated also. How should I tackle this issue? I was personally thinking of an if statement and an array. Where if the option for random numbers was selected, they would be randomly generated, else (the second option) there would be a predefined set of math questions in an array that would be loaded onto the users' screen.

If my question requires elaboration because it's unclear or lacks information I'd be more than happy to change my question.

Kind regards, Ares.




Aucun commentaire:

Enregistrer un commentaire