Access Video Quiz D3.2
By Richard Rost
4 hours ago
What Range of Values Does VBA Rnd Function Return? What range of values does the VBA Rnd function normally return? Welcome to another Microsoft Access Video Quiz. You will answer five developer-level questions covering VBA randomization, including constants, Randomize, the Int function, and generating whole numbers within a specified range. Check your score to see how well you know these random number techniques. Recommended CoursesWant More?KeywordsAccess Video Quiz, VBA Rnd function, VBA Randomize, VBA random number generation, VBA Int function, VBA random whole numbers, VBA random number 1 to MaxValue, VBA random integer range, VBA constants, VBA Const declaration, VBA die roll code
More InformationTranscript Welcome to another video quiz from Access Learning Zone. This one's for developer-level users.
I've got five questions covering VBA randomization. You'll have three seconds for each question. Use that pause button if you need more time. Keep track of your scores so we can see how you did at the end.
Are you ready to inventory the dragon's hoard? Here we go.
Question 1. What range of values does the VBA random function Rnd normally return?
All numbers from 0 through 1, a value greater than or equal to 0 and less than 1, whole numbers from 1 to 10, or a value from negative 1 through positive 1.
That's going to be B, a value greater than or equal to 0 and less than 1.
Question 2. Why would a VBA programmer use a constant declaration instead of a normal variable for a maximum quiz value?
It automatically stores the value in a table. It lets the user change the value while the form is open. It gives a fixed named value that code should not change. It makes the value available to every procedure automatically.
That'll be C. It gives a fixed named value that the code should not or cannot change.
Question 3. What's the main purpose of calling Randomize before generating values with Rnd?
It seeds the random number generator so sequences can vary between runs. It converts random results directly into whole numbers. It guarantees that no generated value will ever repeat. It resets every variable on the current form.
That is A. It seeds the random number generator so sequences can vary between runs.
Question 4. For a positive decimal value such as 8.8, what value does VBA return from Int(8.8)?
Is it 8.8, 9, 0, or 8?
That's going to be D, 8.
Question 5. Which expression correctly generates a whole number from 1 through MaxValue when MaxValue is a positive integer?
There are your four options. Read them over and select one. Hit that pause button now if you need more time.
That's going to be B, the Int of, in parentheses, Rnd times MaxValue plus 1.
So, if you want a die roll from 1 to 6, you'd change MaxValue to 6.
All right, how'd you do? Did you get all five right? Are you a grand curator of the hoard, with every coin accounted for? Or are you still trying to decide if the golden spoon is treasury or cutlery?
Well, if you missed one, these topics and more are covered in Microsoft Access Developer Level 3, and Lesson 2 is all about random number generation.
Thanks for playing. Be sure to post your score in the comments down below, and try not to wake the dragon.
Until next time, live long and prosper. Intro What range of values does the VBA Rnd function normally return? Welcome to another Microsoft Access Video Quiz. You will answer five developer-level questions covering VBA randomization, including constants, Randomize, the Int function, and generating whole numbers within a specified range. Check your score to see how well you know these random number techniques.
|