From the course: Visual Basic Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Marble draw with lists

Challenge: Marble draw with lists - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

Challenge: Marble draw with lists

(upbeat tempo) - For this challenge, you'll code a classic probability problem. It's the drawing marble contest. On the table are two empty buckets. One painted red and the other painted blue. In the center of the table is a large golden bucket that contains 50 red marbles, 50 blue marbles, and one gold marble. The contestant draws out one marble at a time, and places it in its matching colored bucket. The contest is over when the gold marble is drawn. The later the gold marble is drawn, the better the prize. I've already stubbed in some code for you. I've got this UI here, which has three columns. Blue, red, and farthest. So this would represent the blue bucket, the red bucket, and this represents how far you got before you drew the gold marble. And then over here we have the average. The way this would work, it would look like this. The first time you run it, you draw four blue marbles and five red marbles.…

Contents