1. Avoid duplication of topics
The previous program uses random functions to implement random questions, but it repeats again. The time seed should be added and randomly subject to change over time. Each random topic may also have the same, should be saved for each result, generate new topics and save the results of the match, if the same is regenerated.
2. Customizable quantity/Printing method
to the topic number N, starting from 1, can represent the number of topics, by the user input the value of n, loop n times to achieve. The display form is set up in many ways, and is selected by the user.
3. The following parameters can be controlled: whether there is a multiplication method, whether there is a bracket, a range of values, plus or minus negative numbers, the division has no number, no support score (true score, false score, ...), whether to support decimals (accurate to how many digits), the interval of each line in the printing can be adjusted
Write the selection structure, the addition and subtraction and multiplication method separate, by the user choice, also can choose whether there are brackets, plus or minus negative, Division has no number, no support scores, whether support decimals, etc.
Using the IF-ELSE structure, we add the range to the arithmetic number and the result;
Also with the if structure to achieve the constraints, the specific use of 0 compared with the limit has no negative, the remainder and 0 compared to limit the number of zero and support scores, set the data type limit decimal, and so on.
Arithmetic 2 design ideas