Web servers - Chapter 6 Methods 205 // Fig. 6.11: RollDie2.cs

Chapter 6 Methods 205 // Fig. 6.11: RollDie2.cs // Rolling 12 dice with frequency chart. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; public class RollDie2 : System.Windows.Forms.Form { private System.Windows.Forms.Button rollButton; private System.Windows.Forms.RichTextBox displayTextBox; private System.Windows.Forms.Label dieLabel1; private System.Windows.Forms.Label dieLabel2; private System.Windows.Forms.Label dieLabel3; private System.Windows.Forms.Label dieLabel4; private System.Windows.Forms.Label dieLabel5; private System.Windows.Forms.Label dieLabel6; private System.Windows.Forms.Label dieLabel7; private System.Windows.Forms.Label dieLabel8; private System.Windows.Forms.Label dieLabel9; private System.Windows.Forms.Label dieLabel10; private System.Windows.Forms.Label dieLabel11; private System.Windows.Forms.Label dieLabel12; private Random randomNumber = new Random(); private int ones, twos, threes, fours, fives, sixes; // Visual Studio .NET generated code // simulates roll by calling DisplayDie for // each label and displaying the results protected void rollButton_Click( object sender, System.EventArgs e ) { // pass the labels to a method that will // randomly assign a face to each die DisplayDie( dieLabel1 ); DisplayDie( dieLabel2 ); DisplayDie( dieLabel3 ); DisplayDie( dieLabel4 ); DisplayDie( dieLabel5 ); DisplayDie( dieLabel6 ); DisplayDie( dieLabel7 ); DisplayDie( dieLabel8 ); DisplayDie( dieLabel9 ); DisplayDie( dieLabel10 ); Fig. 6.11 Simulating rolling 12 six-sided dice. (Part 1 of 3.)
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Leave a Reply