Home > database >  See a others write about students test code, including a is the random serial number. Do not underst
See a others write about students test code, including a is the random serial number. Do not underst

Time:09-21

Close all & amp; & Close all types of files
& & The following program segment random sequence number is created for the library name
USE XMK. DBF & amp; & Using XMK. DBF file
The DO WHILE. Not. EOF ()
The REPLACE of SJH WITH INT (RAND () * 10000)
The SKIP
ENDDO & amp; & End the DO function
USE & amp; & Close the XMK. DBF

The random sequence number is created for the library name here is what mean? What's the use?
I don't understand.
Rows venue is according to the last exam, why with random serial number?

CodePudding user response:

INT (RAND () * 10000)
1. First of all, the RAND () resulting from 0 to 0.9999999... The numerical,
2. Second, the RAND () * 10000, a 0 to 9999.999...
3. Again, the INT (RAND () * 10000, 0 to 9999

CodePudding user response:

In fact, the above are not truly random, is there are a lot of repetition.

CodePudding user response:

VFP this function is not really a random number, just repeat the question, his law of random Numbers generated (order) is unchanged,

CodePudding user response:

reference 1st floor mywisdom88 response:
INT (RAND () * 10000)
1. First of all, the RAND () resulting from 0 to 0.9999999... The numerical,
2. Second, the RAND () * 10000, a 0 to 9999.999...
3. Again, the INT (RAND () * 10000, 0 to 9999

What's the use of the generated random order?

CodePudding user response:

Arrange the examination room seat number

CodePudding user response:

No random value, you specify one

CodePudding user response:

There is no complete code, might say not clear

In addition, other people's code is not reasonable

CodePudding user response:

Estimation is to generate test data, no other use,

CodePudding user response:

Academic tests that the use of random?

CodePudding user response:

Learning, the estimate is to generate test data, no other use,

CodePudding user response:

The set talk off

Close all
The clear

1
seleUse the test list. DBF
Go the top

Num=RECC ()
Temp=num
DIMENSION ZKZ (num)

For I=1 to num
ZKZ (I)="1805" + padl (I, 4, "0") & amp; & Generate the order of admission ticket number
Endfor

1
seleGo the top

Rand (1)
For I=1 to num
R=int (round (rand (), 10) * temp) + 1 & amp; & For the rest of the admission ticket of randomly selected a
Repla ZKZH with ZKZ (r)
Temp=temp 1 & amp; & Your admission ticket number less a
For j=r to temp & amp; & Component removal has been with the admission ticket of new array
ZKZ (j)=ZKZ (j + 1)
Endfor
The skip
Endfor

go top

CodePudding user response:

Try this, you that not line,

CodePudding user response:

If it is to use the last result row, so use random number also can avoid to produce the same points is not random case
If you want to random, must use the rand (1) this, otherwise the random is 0 ~ 9 randomly

CodePudding user response:

I have written this random examination room seat program, integrated the above several,
I think:
First, in a do ~ while loop using the REPLACE of SJH WITH INT (RAND () * 10000), redundant,
The second, "the REPLACE of SJH WITH INT (RAND () * 10000)," isn't really random,

It is recommended to use double random address:
Rand (1) & amp; & Initializes the random function
The REPLACE of SJH WITH INT (RAND () * 10000) all & amp; & Direct use of ALL the overall replacement can be here, it is not necessary to use cycle,
==================================================================
USE XMK. DBF & amp; & Using XMK. DBF file
Rand (1) & amp; & Initializes the random function
The REPLACE of SJH WITH INT (RAND () * 10000) all & amp; & Direct use of ALL the overall replacement can be here, it is not necessary to use cycle,
USE & amp; & Close the XMK. DBF

So you can finish your hair of the function of the procedures section, randomness should be better,
  •  Tags:  
  • VFP
  • Related