OOP - Practice 1 Notes

Higher or Lower Program Questions

Game Start

  • The user starts each game with 50 points.

getCard() Function

  • The getCard() function removes the card from gameDeckList.

NCARDS Change

  • If NCARDS = 8 is changed to NCARDS = 60, the program would need a deck of at least 60 cards to function correctly. Otherwise, it may run out of cards.

Deck Shuffling

  • The deck of cards is shuffled when the game is initialized or when a new game starts.

Card Repetition

  • a. The same card cannot be drawn more than once in each game.
  • b. The same card can be drawn more than once in one run of the program but in different games.

Textbook Error

  • The line currentCardSuit = nextCardSuit is actually needed, contrary to what the first printing of the textbook and the e-book suggest. Without it, the program will not function correctly.