20194582 automatically generates four arithmetic problem first edition report

A needs analysis

To write code automatically generated by the four arithmetic code, using four operations to automatically generate the program title can be further cultured primary computing capacity, the ability to improve the operation, and reduce the workload of teachers and parents the title C language or JAVA.

Two functional design

(1) automatically generates four arithmetic operation of Equation 2 number less than 10 100 (+ - * /), operation results are required within 100

(2) discarding duplicates equation. = 2 + 3 + 3 = 2 and Equation 2 is repeated and 3 + = 3 + 2 = not repeated formula

Number (3) title can be customized

(4) parameters can be controlled

          Whether to include multiplication and division

          Controllable range values ​​of the operands (e.g., operands within 100 or within 1000)

          Whether operands containing negative    

  (5) generating operation to an external file title stored in result.txt

Three design and implementation

Defined four variables, a number of control operation range, a control amount, one control symbol, whether a negative control. Input operand range 100-1000, enter the number of items, it is determined whether the negative, generating a random number between 0-99 stdlib.h header file using the rand function, and then generates a random number between 0-3 to represent the symbol . Using the switch statement four arithmetic operations. Final output.

 

 

Four test runs

 

 

 

 

Five snippet

 

 

 

 Six summary

Most previous study for the exam, do it yourself a little time-consuming coding, through this code, more familiar with the processes and operations. After more practice to practice.

Seven PSP

PSP2.1

SUMMARY

Plan time (min) required to complete a total of

The actual time required for completion (min)

Planning

plan

81

99

·       Estimate

· Estimate how much time this task requires, and planning generally work steps

8

5

··       Analysis

  Needs analysis (including learning new technologies)

5

8

·       Coding Standard

  Code specifications (development of appropriate norms for the current development)

3

5

·       Design

  Specific design

10

12

·       Coding

  Specific coding

30

35

·       Code Review

· Code Review

5

10

·       Test

·  测试(自我测试,修改代码,提交修改)

10

15

··       Test Report

·  测试报告

2

2

·       Size Measurement

  计算工作量

3

2

·       Postmortem & Process Improvement Plan

·  事后总结 ,并提出过程改进计划

5

5

 

Guess you like

Origin www.cnblogs.com/804705563ccr/p/11528803.html