← Back
Code Challenge 16 - Raffle
Introduction
A raffle is a simple contest where many individuals can submit one or more entries, and a winner is picked at random.
Skills to Practice
- Adding elements to an array
- Repeating code with loops
- Generating a random index
Challenge Tasks
- Create a console project named CodeChallenge16Raffle.
- Let the user input names to enter into the raffle. Enter the names into an array.
- If you’re using a statically sized array, such as with C# or C++, you can set a size/limit of 100 contestants.
- When the user is finished adding entries, draw a random winner from the array.
Sample Output