Purchase Solution

C# guess the larger number game

Not what you're looking for?

Ask Custom Question

Write a C# Windows Form program to pick the larger of randomly generated numbers.

1. Create a Form that contains two randomly generated parallel arrays, each containing 100 numbers.
2. The random number generation for both arrays will be done in a method, both when the arrays are first populated and when they have to be repopulated.
3. The form will have two buttons labeled 1 and 2 and one button labeled Next.
4. Starting with position 0 in each array, ask the user to guess which of the two arrays contains the higher number and click on one of the two buttons (1 or 2) to enter the guess.
5. Use the following text in a label to prompt the user: Which one will contain the higher number? Make your choice, view your score, then click Next.
6. After each button click, the program displays the values of the two compared numbers.
7. If the button clicked does hide the larger number add 1 to a running counter for right answers; if the button clicked does NOT hide the larger number add 1 to a running counter for wrong answers. Use a label to display the running total of both the right and wrong guesses.
8. After a user clicks a button (1 or 2) for their guess disable the buttons (1 and 2) while the user views the results (running totals).
9. When the user clicks the Next button, the user can then make another guess and the program will use the next two corresponding array numbers from the two parallel arrays.
10. If the user makes more than 100 guesses, the program should use the randomization method to repopulate the random numbers in both arrays and reset the array subscripts to 0 so the comparisons start over, but continue the running totals.

Purchase this Solution

Solution Summary

Solution contains attached a complete C# project with an executable. The Form is neatly designed and performs the requested guessing game functionality.

Solution Preview

Please find attached the zipped C# project which contains an executable. The Form is neatly designed and performs the requested guessing game ...

Purchase this Solution


Free BrainMass Quizzes
Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

C# variables and classes

This quiz contains questions about C# classes and variables.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

C++ Operators

This quiz tests a student's knowledge about C++ operators.