Introduction to Programming using Visual Basic

In this video we create our VB.net subs that process the win controls on our winform.

What is the probability that the underdog will win the World Series of Baseball? What is the average number of games for a World Series?

Write an animated program to answer these questions. For instance, suppose that the underdog is expected to win 40% of the time.

We say that the probability of the underdog’s winning a game is 40%. (In order for a team to be the underdog, the probability of winning must be less than 50%).

For example, the probability of 40% underdog’s winning the World Series is about 29%, and such series would last an average of 5.7 games.

The program should simulate the playing of 10,000 World Series where the underdog has the probability of winning that was entered

into the first text box. The values of the horizontal scroll bars should extend from 0 to 10,000 and should be calculated

after each series so that the scroll boxes steadily move across the bars.

NOTE: In order to spare VB from being overwhelmed with changing the values in the twelve text boxes to the right of the scroll bars too often, just change the values after every ten series. Also, every time the values are changed, execute a Refresh method for each of these text boxes.

DOWNLOAD SOURCE CODE: ch9-pp5-UnderdogWorldSeries

## Comments