C#_Maya_Angelou
New Coder
Greetings,
I am looking for assistance in getting the code for the following questions. Please advise as to which controls will be used for each as well.
1). Write a program that initially displays the number 1 in a label. Clicking a button should increment the value. Make use of an instance variable initialized to 1, and set up the label in the constructor. [Note: Do not set the label’s Text property to 1 in the Properties Window at design-time.]
2). Write a program that produces a random number between 200 and 400 each time a button is clicked. The program should display this number, and the sum and average of all the numbers so far. As you click again and again, the average should converge on 300. If it doesn’t, we would suspect the random number generator – just as we would be suspicious of a coin that came out heads 100 times in a row! [Note: Do not create more than one instance of the Random class.]
3). Betting. A group of people are betting on the outcome of three throws of the dice. A person bets R10 on predicting the outcome of the three throws. Write a program that uses the random number method to simulate three throws of a die and displays the winnings according to the following rules: • All three throws are sixes: win R200; • All three throws are the same (but not sixes): win R100; • Any two of the three throws are the same: win R50. Additional notes: • Do not create a Random object more than once. • Do not use more than three if statements
I am looking for assistance in getting the code for the following questions. Please advise as to which controls will be used for each as well.
1). Write a program that initially displays the number 1 in a label. Clicking a button should increment the value. Make use of an instance variable initialized to 1, and set up the label in the constructor. [Note: Do not set the label’s Text property to 1 in the Properties Window at design-time.]
2). Write a program that produces a random number between 200 and 400 each time a button is clicked. The program should display this number, and the sum and average of all the numbers so far. As you click again and again, the average should converge on 300. If it doesn’t, we would suspect the random number generator – just as we would be suspicious of a coin that came out heads 100 times in a row! [Note: Do not create more than one instance of the Random class.]
3). Betting. A group of people are betting on the outcome of three throws of the dice. A person bets R10 on predicting the outcome of the three throws. Write a program that uses the random number method to simulate three throws of a die and displays the winnings according to the following rules: • All three throws are sixes: win R200; • All three throws are the same (but not sixes): win R100; • Any two of the three throws are the same: win R50. Additional notes: • Do not create a Random object more than once. • Do not use more than three if statements