Introduction to Software engineering the second-week comprehensive test----design ideas

Source: Internet
Author: User

Arithmetic 2

Program requirements: The topic to avoid duplication, can be customized (quantity, printing method); You can control the following parameters: whether there is a multiplication method, the range of values, plus or minus negative numbers, Division has no number, whether the score is supported.

Design ideas:

1, the topic to avoid duplication: first first question, then the second problem first to judge the second problem of the operation if the first problem is equal to: the second question of the first random number if equal to the first question of the first number and the second question of the second random number equal to the second number of the first question, then re-select the number. otherwise continue. The third question is also judged from the operator.

2, can be customized quantity, printing method: Set a variable, variable according to user needs input. That is, "Please enter the number of topics you want:" and "number of printed questions per line:".

3, the value range can be changed according to user needs, then set the variable,rand()%a, by entering a value to control.

4, the following parameters can be controlled (I simplify the block according to my own idea): Set the options in the General program framework, the initial implementation of the problem is implemented in its options, is equivalent to a piece of paper on the block. A piece of the problem only this piece of this kind of problem. The student chooses which option to do that piece of question. It is divided into whether there is a multiplication method, there is no negative, there is no number, whether support scores and so on several pieces.

(1) There is the multiplication method: Division 0 can not do divisor, if 0 is the divisor then the first number and the second number of the value.

(2) There are negative numbers: negative numbers appear in random numbers. The sensation can be controlled by controlling the range of values.

(3) Surplus number: In the case of division, the divisor cannot be divisible by the divisor, if divisible, the divisor (or divisor) is changed.

(4) Support score: Set four random number, denominator cannot be 0.

Summary: The initial idea is to first block the implementation, the final sum of time may have some functions can not be well integrated. According to my idea is the first implementation of the block, choose which option, in the block only this type of problem. Run the tiles first. Finally, by changing the order of functions to integrate.

Introduction to Software engineering the second-week comprehensive test----design ideas

Related Article

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.