Personal Items 2--Arithmetic

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.