Introduction:

This is the first ‘mega challenge’ for the C# Fundamentals via ASP.NET Web Forms Applications course. It is dubbed a mega challenge due to the fact that it combines a wide variety of techniques and methods you have learned so far in the course. It will take a good amount of time and a lot of thought in order to complete, but if you do, then you’ll know that you’ve got a good grasp on what’s been taught so far in this series.

Requirements:

This challenge is called MegaChallengeCasino, in which you are to build a slot machine application that will allow the user, or player in this case, to bet a certain amount of money, spin the reels on the machine, and either win or lose money based on the result. The template looks like this:

initial

You’ll be provided with images for the different reel options, as well as images showing what the message should be if the player won or lost. The basic rule is this: If the player bets and presses the button, they will win money in the following scenarios:

  • 2x Bet for 1 Cherry
  • 3x Bet for 2 Cherries
  • 4x Bet for 3 Cherries
  • 100x Bet for three 7’s

Aside from these cases, the player will always lose the amount they bet. The one other case is that if a BAR image is present, they will lose their money, even if there was an otherwise winning condition.

The full instructions and requirements for this challenge can be found in the CS-ASP_034MegaChallenge_Code folder attached to this.

The main nonfunctional requirement for this challenge is that the methods you create must remain within 6 lines of code. If they exceed that number, odds are they are too general and need to be refined. This challenge will require you to create a wide variety of helper methods in order to solve it.

Conclusion:

Ultimately, if you meet the requirements laid out for this challenge, you will have successfully solved it; even if your solution doesn’t match the one given in the solution document. There are many, many ways to successfully complete this challenge, and yours might even be better than the one provided.

As always, if you get stuck and need a hint or need explanation, read the solution only as much as you need to in order to solve the issue you’re having. Good luck!


Lessons in this Course