Writing Methods
Challenge
Update our deck of cards program from the Data, Data, Data... Challenge and All about Enum. In this challenge, add methods to deal cards to players and print the cards to the console.
- a no parameter method that deals 5 cards to 2 players
- a method with a parameter for number of cards to be dealt to 2 players
- a method with two parameters: one for the number of players and one for the number of cards
These methods will print the cards directly to the console.
Webinar
In this webinar, we will write classes and methods. Further, we will use this knowledge to improve our Card game program by dealing cards to players.
Watch the Recording
Resources