Personal operations of software engineering 02 -- version 2 and version 2 of software engineering 02

Source: Internet
Author: User

Personal operations of software engineering 02 -- version 2 and version 2 of software engineering 02

Note:

/*

The first version can automatically generate 30 arithmetic questions for the four primary keys. In addition to integers, the first version also supports the four arithmetic operations of false scores.

This is to first change the first version of the oriented process to object-oriented, and then design the second version.

The requirements for the second edition are:

1. Avoid repeated questions ;_

2. Customizable (quantity/printing mode );_

3. You can control the following parameters:

Whether multiplication or division exists;

Whether there are Parentheses (a maximum of 10 supported for calculation );

Value range;

Add or subtract negative numbers;

Division has no remainder!

 

The limit for the second version is up to 2000 questions.

 

If you want to do not repeat, you need to represent the divisor and the divisor in an array respectively so that you can use them later to compare whether there are duplicates.

When determining whether the number is repeated, the method used is not to judge the first number at a time and the second number and the symbols are equal at the same time. In this way, three values need to be compared each time;

I used to first judge the first one. If it is the same as the one above, compare the second one. If the second one is the same, compare the symbols. In this way, only when one is satisfied,

Otherwise, you do not need to compare them at all, so you can simplify the comparison process.

 

 

The idea of this program is different from the current programming philosophy: Output all the conditions for the user to choose.

Then, the selected conditions are randomly displayed based on the conditions. For example, if there is multiplication or division, it will appear randomly. If not, it will not appear.

It is probably based on the idea of adding, querying, deleting, and other programs in the freshman address book.

 

The main of this program implements the above idea, which is much clearer than the first second version. However, questions are still avoided; customizable (quantity, whether there is multiplication or division, and Numerical range.

*/

 

Main:

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.