Please enable JavaScript to use CodeHS

AP Computer Science A Labs

Blackjack Lab

Students learn how to use basic data structures in Java including arrays, ArrayLists, 2-dimensional arrays, and HashMaps to create a game of Blackjack.

Note: this lab contains topics (HashMaps) that are now considered out-of-scope for the AP CSA exam. In order to complete this lab, students will need to learn about those topics beforehand, in addition to completing the recommended units below.

Students can complete this assignment after finishing Unit 4: Data Collections in Cortado, and Unit 7: ArrayLists in AP CS A (Nitro), Unit 5: Data Structures in AP CS A (Mocha).

Lessons

14.1 Writing BlackJack

  • The Card Class
  • The Card Class
  • The Deck Class
  • The Deck Class
  • The Hand Class
  • +4 more

Courses that include this module