20194726 automatically generates four arithmetic problem first edition report

First, the needs analysis

     Making operation code.

Second, the 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

Third, the design and implementation

   

 

 

 

Fourth, the test  

V. snippet

#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define RANDOM(v1,v2)(rand()%((v2+1)-(v1))+(v1))
#define N 10
int main()
{

int V1, V2, I, n-, A;
a float C, D;
char OP, OPS [] = { '+', '-', '*', '/'};
srand (Time (NULL));
do
{
the printf ( "\ n-enter the number 1 starts, -1 exit the program:");
Scanf ( "% D", & n-);
Switch (n-)
{
Case 1:
{
for (I = 0; I <N; ++ I)
{
V1 = RAND ()% 201-100;
V2 = RAND ()% 201-100;
OP = OPS [the RANDOM (0,3)];
Switch (OP)
{
Case '+': = A V1 + V2 ; BREAK;
Case '-': A = V1-V2; BREAK;
Case '*': A = V1 * V2; BREAK;
Case '/': A = V1 / V2; BREAK;
}
the printf ( "% D% C D = D%% \ n-", V1, OP, V2, A);
}
BREAK;
}
BREAK;

}

}while(n!=-1);

Six experimental summary 

      The work through the access to information and ask students finally done, good heavy.

Seven, PSP

PSP2.1 SUMMARY

Plan completed required

Time (min)

The actual completion of the required

Time (min)

Planning plan 335 376
Estimate It estimated that the task requires much time and planning generally work steps 60 50
Development Develop 80 100
Analysis Needs analysis (including learning new technologies) 8 10
 Design Spec Generate design documents 30 30
Design Review Design review (and colleagues reviewed the design documents) 30 35
 Coding Standard Code specifications (development of appropriate norms for the current development) 30 35
 Design Specific design 20 25
Coding Specific coding 35 45
Code Review Code Review 10 10
Test Test (self-test, modify the code, submit modifications) 5 7
Reporting report 10 11
 Test Report testing report 2 5
 Size Measurement Computing workload 10 10
 Postmortem & Process Improvement Plan Later summarized, and process improvement plan 5 3

Guess you like

Origin www.cnblogs.com/scgg/p/11530033.html