Arithmetic 2 design ideas

Source: Internet
Author: User

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

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.