computer science

profileDamond
Lab10sc.pdf

2020/6/3 21(20Lab10

第 1 ⻚页(共 3 ⻚页)https://canvas.pasadena.edu/courses/1104811/assignments/8342636

Lab10

Due Jun 10 by 11:59pm Points 200 Submitting a text entry box, a media recording, or a file upload

Submit Assignment

Title: Lab10

Objective: C++ Comprehensive Problem, Black Jack Game

Developed a Blackjack game to allow player interact with dealer (via computer) with interactive menu via console mode.

Activity:

** For each question, write pseudocode definition and apply top-down/bottom-up design principle before going for implementation.

** Please provide sufficient test cases for each question

Problem Description: 0. You will only need to develop the game to support new hand, hit me, stand and hint functionality. Each functionality demonstrated in the subsequent steps. 1. You will need to develop a console menu to allow user to choose on the following: *********************************** 1) New Hand 2) Hit Me 3) Stand 4) Hint 5) Exit *********************************** Your Choice? > 2. Upon user enter "1", you will begin a new game by seeding dealer cards and player cards; the example shown below: Dealer picked the 2 of Diamonds You picked the 8 of Diamonds ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Dealer Value: 2 Player Value: 8 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2020/6/3 21(20Lab10

第 2 ⻚页(共 3 ⻚页)https://canvas.pasadena.edu/courses/1104811/assignments/8342636

*********************************** 1) New Hand 2) Hit Me 3) Stand 4) Hint 5) Exit *********************************** Your Choice? > 3. Based on Dealer face value and the player card value known to the player only, player will need to make the choice of hit me or stand depend on the player's strategy. Let's choose "2" hit me in the console menu to continue the game. the example shown below: You picked the 10 of Diamonds ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Dealer Value: 2 Player Value: 18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ *********************************** 1) New Hand 2) Hit Me 3) Stand 4) Hint 5) Exit *********************************** Your Choice? > 4. Based on the Dealer face value and the player card value known to the player only, player need to make another choice on hit me or stand; please note that #3 step could be repeating many times until player card value is over 21. Let choose "3" stand in the console menu to continue the game, the example shown below: Dealer picked the 4 of Clubs Dealer picked the 10 of Diamonds Dealer picked the 9 of Diamonds House busts! You win! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Dealer Value: 25 Player Value: 18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 5. Once Player stands, the dealer will pick the card until dealer card value reaches 17 or larger. In some cases, dealer will have card value over 21 which considered busted. That is the case demonstrated above. 6. There is a general guideline for player should use hit me or stand depend on the current player card value and dealer face value. You should implement 4 for Hint to print out the hint table and give suggestion based on dealer face card and player card value. Suggest H for the D and H for the h in the chart below. [Please note, you should load the hint table from the file and store in memory] ^^^^^^^^^^^^Dealer Card^^^^^^^^^^^^ Player 2 3 4 5 6 7 8 9 10 A 5-7: H H H H H H H H H H 8: H H H D D H H H H H

2020/6/3 21(20Lab10

第 3 ⻚页(共 3 ⻚页)https://canvas.pasadena.edu/courses/1104811/assignments/8342636

9: D D D D D H H H H H 10: D D D D D D D D H H 11: D D D D D D D D D D 12: H H S S S H H H H H 13: S S S S S H H H H H 14: S S S S S H H H H H 15: S S S S S H H H H H 16: S S S S S H H H h h 17: S S S S S S S S S S ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Suggestion: [Hit or Stand] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 7. Additional validation on the console menu should prevent player choose new hand without finishing previous player session. 8. Of course, you can always add your own idea into this lab. Note: For the complete rule of blackjack referenced in this homework, go to, https://wizardofodds.com/games/blackjack/strategy/4-decks/ Note: You need to load the suggestion chart from the file, blackJack-play-suggestion.txt attached, using file input stream; For File I/O example, please refer to lecture deck, Week12-13.pdf in the file section.

Deliverable:

* Upload solution project source file in zip format

* Submit the Lab Report in a single word document with screenshots, code illustration, run result to canvas website.

* Please use lab template file to complete your report.