Home » Previous Subjects » Fall 2013 – Subjects » Week 5 — Control Structures » Wednesday Instructions and Notes

Wednesday Instructions and Notes

Monday, we started a simple card application, for building a deck of cards.

Part of the exercise is thinking about how one would build a physical deck of cards, given a marker and some blank cards.  What would your thought process be?  How would you create the cards so that every card is represented, without missing any?

We took a hurried stab at it, using a foreach loop in order to go through each of the possible suits.  Here is the project as of Monday –> SimpleCardApp

Unfortunately, this will only create 4 cards: The ace of spades, the two of hearts, the three of clubs, and the four of diamonds.

Our task today is to fix this code, using a while loop, so that we build a complete deck of cards.  We’ll then add a button to our form so that we can draw cards at random.


One comment on “Wednesday Instructions and Notes

Leave a Reply

Your email address will not be published. Required fields are marked *