Random Numbers
Practice
Question:
- Make a new form with a
picture box and a command button
- Write down the following
piece of code in the click event of the command button:
Rem
This clears out any text in the Picture Box
Picture1.Cls
Picture1.Print
Rnd
- Run the program and you will
be able to see that for every click on the command button you will be able
to see a new number in the picture box, ranging from 0 to 1 BUT NOT
INCLUDING 1.
Practice
problem:
f. Write a program to randomly select a month and a year during
the 2000s (from 2000 to 2009). A typical outcome would be 7/2004.
0 comments:
Post a Comment