Hi,
I am looking for ideas regarding an automated calculator (so to speak) that will be able to generate 10 RANDOM questions for a console application. The mathematic funtions needed are addition, subtraction and multiplication and the numbers involved (by random selection) must not exceed 12.
Also, if possible, a function will be needed to declare whether or not the inputted answer is correct or not.

Can you help?

You need to become familiar with the Random function. Use it to pick the values you wish to calculate with. Also use it to select a mathematical function; generate a random number from 0 to 2 and use this to specify which of your 3 mathematical functions to use. An enumerated type listing the 3 mathematical functions could be useful.

You also need to get the correct symbol for the mathematical function you select. Maybe hold the three possibilities in an array with the mathematical function as the array index.

You would then have all the elements you need to display the question. You can also do the same calculation to check the user's answer.

All that would remain would be generating 10 questions. A simple FOR loop would do this, generating 1 question each time round the loop.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.