Homework 7

Learning Objectives

In this homework, you will apply the concepts you learned in class to reinforce your understanding of:

Description

In class we looked at a case study utilizing the Model View Controller design pattern in a Black Jack game. For this homework, you need to complete part C of this case study. Specifically, you need to implement the:
  1. userHit() method of BlackJackController. This method should implement the logic of the "user chose to hit" use case.
  2. userStand() method of BlackJackController. This method should implement the logic of the "user chose to stand" use case. When the user chooses to stand, the user's turn is over therefore the "Hit" and "Stand" buttons should get disabled (thus preventing the user from cheating), the dealer's play logic must be executed and game results should be announced with an option to play again. If the user chooses to play again, a new round of Black Jack should start up. If the user chooses not to play again, the original Black Jack window should remain open.
  3. startGame() method of BlackJackController. This method should implement the logic of the start of the game: dealer and player are dealt two cards each, both of player's cards should be visible and one of dealer's cards should be visible with the second card shown face down.

Submitting your solution

Submit all the code necessary for your Black Jack game to hw7 directory of your git repos.

Grading

All submitted code must compile. Code that does not compile will receive a grade of zero. I will be compiling your submissions with the following command:
javac *.java

I will use the list of questions below. Each question can score you from 0 to 3 points (unless otherwise stated): No - 0, Somewhat - 1, Yes - 3. The sum of these points will be your grade for this homework.

  1. When the game is first run do the dealer and the player both get two cards?
  2. Does dealer's hand show one card and hides the other at the start of the game?
  3. When the user chooses to hit, does the user interface show the updated hand?
  4. When the user chooses to stand, does the dealer's play logic get executed?
  5. Does the user interface show dealer's entire hand at the end of the game?
  6. At the end of the game, does the user see the results, as in the prototype presented in the case study?
  7. If the user chooses to play again, does the user interface correctly show new hands that are dealt to the player and the dealer?