O (︶^︶) O Alas, the third assignment

Source: Internet
Author: User

third time Job

1. Demand Analysis

(1) from the Combox control, get a variety of operations (+, =, *,/), the user can enter the range of operations, such as to calculate 0-10 or less, then enter 0 and 10 in TEXTBOX5 and 6 is the line, of course, if the number in 5 is smaller than the number in 6, there will be a message box, and empty them The user can choose the algorithm, set the scope, click on the calculation, enter the result, the carriage return is possible.

2. Design Ideas

(1) Think about what you should do, what effect you want to achieve, and add controls.

(2) Create a Windows Forms design form and conceive the code. Declare the common variables count, and right,t, respectively, represent the total number of topics, the correct number, time, of course, the initial value is 0;

(3) Generate random numbers, my code can be sure that there will be no subtraction negative, to ensure that the primary level does not appear negative, will not appear 5-8=-3 this situation.

(4) Single-Machine TextBox3 KeyDown event, switch () to obtain the algorithm, and operation.

(5) When the click Stops, the timer stops and returns the value of T, which is the user's time. Pop-up Form2 window, close 1 window;

3. The code is as follows:

4. Operation Result:

5, PSP Time-consuming analysis:

PSP: Third time job

Personal Software

Process Stages

Timer (h)
Planning: Plan 5
. Estimate: The estimated time 6
Development: Development 4.7
. Analysis: Demand analysis 0.5
. Design Spec: Creating a design Document 0.5
. Coding Standard Code specification O.2
. Desing Specific design 1
. Coding Specific code 2
. Code Review Code review 0.2
. Text Test 0.3
Repotring Report 1
. Test Report Test report 0.2
. Size Measurement Computer workload O.7
. Postmortem Summary afterwards 0.1

6. Summary

is also really helpless, it seems that the ancients did not bully me, the U disk lost file is really serious, loading project has been open, tools

the most important ah. originally want to add code on the basis of the second job, can ... O (︶^︶) o Alas, the code was all messed up, when

when I re-wrote, found that can be compared to the last simple, a lot less work. Hey, think about whether you can

Simplify the point.

Pairing Programming Summary:

This time with the bedroom Buddies Li Ti Cooperation, feel only two words "good tired", everyone declare variable simply ... O (︶^︶) o Alas, cannot bear to look straight. Personal feeling, the premise of pair programming must be the same as---name, otherwise always add comments. After we finished the idea, I played the code, each completed one, our differences are great, always feel the need to add something. So, I decided to play a decisive self, add good comments, to him perfect.

7. Add a question

(1) To handle the user's error input, such as input letters or symbols, processing division operation denominator 0 case, the processing result is negative, to ensure that the primary level does not appear negative, such as can not appear 5-8=-3 this situation;

This problem I have solved, when generating random numbers, has been qualified, the second number is always less than the first number
2) User can set the countdown

This question I let the user to customize the choice to do the time, I do the countdown time appears the assignment is unsuccessful the question, therefore can only design the normal timing.
3) The user can set the range of random integers;

This problem I set TEXTBOX5 and 6, in the generation of random numbers, according to the values of 5 and 6 to generate a random number. Of course, set 5 must be greater than 6, otherwise prompt information, and empty.
4) The user can choose which type of calculation, such as subtraction, or can choose the software randomly generated arithmetic one.

The Combox control obtains the operation symbol, this question also solves perfectly. Well, it's settled.

O (︶^︶) O Alas, the third assignment

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.