Everyone should know how to play 21!
Everyone has played the game of 21 before (I think), where you count the values on the card and face cards are worth 10. You try to get as close as possible to 21, without going over. If you beat the dealer, you win the money. The problem is the dealer has a better chance of winning, so, in the end, you just lose your money!
Create a program to simulate a simplified version of the game 21 against the computer. A deck of cards numbered 1 to 10 is used and any number can be repeated. The program starts by dealing the user 2 randomly picked cards and itself 3 that are not revealed until “Check” is clicked. The user may then draw 1 additional card if they want. If the user and computer scores are both over 21, or if both are equal but under 21, the game is a draw. Otherwise, the winner is the one with the highest score less than or equal to 21.
- This is a 2-week assignment:
- Week 1 hand in DESIGN AND TEST CASES ONLY
- Week 2 hand in EVERYTHING (INCLUDING ABOVE)
- Each week ENSURE you include the Marking Rubric
- If you are not sure on any part of the problem, just ask me and I will give you additional information
- You must do the program in Python first (get a 3+). You can get a 4+ by doing the program in another programming language
- See Marking Rubric below
- Ensure you work through (in order):
- GUI design
- Top-down (always only 1)
- Flow-chart (for each "event")
Pseudo-code (you do not need to do it anymore!)- Final, debugged, commented code
- NO GitHuub link!!
- Remember to think, Input – Process – Output, when designing your program
- The final assignment MUST be in one (1) *.pdf file when you are submitting each part
- Part A:
- Document Name
- ensure it is the assignment #, course code, and your full name
- Cover Page
- this will include the assignment #, course code, and your full name
- Checklist
- documenting the parts of the assignment that are to be included and stating that you have included them
- Design Document(s):
- this includes GUI Design, Top-down Design, Flow-chart(s) and no
Pseudo-code
- Test Cases:
- at least three (3) test cases (maybe more if it is needed!); think about what would you need for test cases in this game?
- Marking Rubric:
- ensure you include the correct assignment marking rubric
- ensure you "merge" it with your document, but do not just paste it onto a page at the end
- Part B:
- Document Name
- ensure it is the assignment #, course code, and your full name
- Cover Page
- this will include the assignment #, course code, and your full name
- Check List
- documenting the parts of the assignment that is to be included and stating that you have included them
- Design Document(s):
- this includes GUI Design, Top-down Design and Flow-chart(s)
- Test Cases:
- at least three (3) test cases (maybe more if it is needed!) done by some other method than your (or some else's) program
- Screen Shots:
- screenshots of your running program
- you will include a screenshot for each test case you have from above, proving your program actually works
- Code:
- you must get ALL of the code into your document (in a logical order) as plain text.
- Github link
- Marking Rubric:
- ensure you include the correct assignment marking rubric
- ensure you "merge" it with your document, but do not just paste it onto a page at the end