Personal Items 2--Arithmetic
On the basis of generating arithmetic expression function in personal item 1, the function is expanded.
1. Avoid duplication:
The two numbers of the expression are computed by operation to generate a number, as follows: The previous number *10000, the next number, the resulting two numbers are added, and stored in the array, with "= =" to determine whether the resulting number is the same as the number in the array? If different, output the expression, or regenerate it.
2. Can be customized (quantity, printing method)
Set the "Number of questions", "printing method" two parameters, pass the value of the two parameters passed into the corresponding function function. By assigning values to these two parameters, the user is required to customize the number of topics on the output and the number of topics on each page.
3. You can control the following parameters:
Whether there is a multiplication method, a range of values, plus or minus a negative number, the division has an amount of zero, whether the score is supported (true score, false score)
① to determine whether there is a function of the multiplication method:
The variables that control the operator of the expression are judged before the output function is called, and if it is multiplication sign or division sign, the expression is regenerated, otherwise the output.
② functions for controlling the range of values:
The random number generated by the random function takes the remainder operation, and the divisor is the maximum value of the range.
③ plus minus has no negative function implementation:
Whether the odd-even control number of random numbers produced by a random function is negative.
The ④ division has an all-in-one function implementation:
The expression is judged before the expression is output if the remainder is set to 1, otherwise set to 0, depending on the user's custom to decide whether to output the expression of the surplus number.
Set the parameter selection function on the interface, choose different parameters to enter different case, and each kind of type is called different function function.
Personal Items 2--Arithmetic