CS320n - Assignment 9
Placed online: Friday, April 24
Due: no later than 11 pm, Monday, May 4
Value: 30 points. about 4% of final grade
Purpose: To create a LabVIEW program using arrays and loops
You can complete this assignment with one other person. Include a label on the front panel and block diagram indicating who worked on the program.
Complete a LabVIEW program that simulates rolling a pair of 6 sided dice, multiple times.
Here is the complete problem statement:
Build a VI that simulates the roll of two dice (possible values 1-6 per die, possible values for the pair of dice 2 thorugh12) and keeps track of the number of times the values 2 through 12 are rolled. Your input is the number of times to roll the dice, and the outputs include (for each possible result 2 through 12) the number of times that values was rolled.
Hints:
Create an array of size 13. This array will have indices from 0 - 12. Use the result of a roll of a pair of dice as the index of the array.
You will need a shift register to pass the array from one iteration of the loop to the next.
Test your program by rolling the dice 36,000 times. 2 and 12 should each occur about 1000 times, 3 and 11 should each occur about 2000 times, 4 and 10 should each occur about 3000 times, 5 and 9 should each occur about 4000 times, 6 and 8 should each occur about 5000 times, and 7 should occur about 6000 times. There will be some small variance in these numbres.
Turn in your LabVIEW program using the Turnin program.. The name of your world shall be your UTEID followed by a dash and a9. For example, my UTEID is scottmd3 so my world would be named scottmd3-a9.vi. Turn the file in via the Turnin program no later than 11 pm, April 28. If you work with a partner you only need to turn in one file, but be sure both of your names are on the front panel!