March 10 Tuesday Classroom Exercise: An extension of the program for automatically generating arithmetic topics

Source: Internet
Author: User

A preliminary analysis of the requirements of the topic:

1. Determine if two random numbers are the same
Save (cycle) The resulting topics and compare the results (loops).

2. Add more than one variable num to control the number of questions

3, in each switch select the statement, make a choice to judge
3.1 Choose whether there is a multiplication method,
3.2 Whether there are parentheses

Determine whether the subtraction is present, add or subtract the position in the calculation, and then choose whether to append parentheses

3.3 Range of values

Mainly control the size of the modulus remainder of the random number generator (e.g. A=rand ()%n,n can take any value)

3.4 plus minus with no negative numbers

Compare the size of meiosis and minuend
3.5 Division has no number

Modulo remainder operation by divisor (random number) and divisor (random number)
3.6 Support Score (true or false score)

Determine whether the division operation, if not the case, then choose whether to support the score, judge the divisor and the size of the divisor, to analyze whether it is true (false) score
3.7 Whether decimal is supported

Change the type of random number (int, flort) according to the user's choice
3.8 printing per line interval can be adjusted

To change the number of topics per row by modulo redundancy.

March 10 Tuesday Classroom Exercise: An extension of the program for automatically generating arithmetic topics

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.