COMP 220

COMP 220

Comp 220
Week 1 Lab
Assignment Objectives:
In this assignment, a program is written to perform an automated blackjack game. There are between one and four players and a dealer, in the game. The object of the game is to have the highest score closest to 21, without going over it. Each player is dealt two cards and the dealer’s first card is hidden. Each round the player (except the dealer) will have the choice to be given another card, or hit. If they do not wish to have any more cards, they choose to stand. After the game is over the players are shown the totals for each hand, followed by a “win” or “lose”.
When the game has ended, the users have the option to play again or quit. Should they choose to play again, the number of players must be entered again and the game will play again. If they choose to quit, the game ends with a “thanks for playing” message and closes.
Test Plans:
The following test plans have been executed to find any errors in the program. The table gives the inputs and the expected outputs for each.
Testing for the number of players input:
There should not be less than 1 or more than four players. The following tests are to determine if the program redirects any faults for the incorrect inputs.
Input
Expected Output
Actual Output
1
Start the game with 1 player plus the dealer
Start the game with 1 player plus the dealer
3
Start the game with 3 players plus the dealer
Start the game with 3 players plus the dealer
12
Redirect the user to enter the correct value (1-4)
Redirect the user to enter the correct value (1-4)
0
Redirect the user to enter the correct value (1-4)
Redirect the user to enter the correct value (1-4)


Screenshots of tests:
Input 1

Input 3




Input 12

Input 0





Testing for correct gameplay:
Check for proper math on final scores
Check that the Aces are being handled properly
Check that cards are not being repeated in the game, to mimic a 52 card deck
Check that the...

Similar Essays