Assignment 8

A Better Game of 21


Did we not already do this, twice!

Yes, we did but most games have a version 3.0!


Here is the problem

Create a program to simulate one deck (this time remember NO card can be drawn twice!) version of the game 21 against the computer. This time, you now know how to make structures and do OOP. Create a class called “DeckOfCards” and a second called "Cards" and use these classes in your game. It should have all the fields and methods you need like:

  • Shuffle deck
  • Get card value
  • Get card picture
  • ...

Two Part Assignment

  • 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

Things to note

  • If you are not sure on any part of the problem, just ask me and I will give you additional information
  • Week 1 give me the design (Class diagram and flow-chart(s)). Week 2 give me the rest.
  • Remember to think OOP this time. Also, code reuse is a beautiful thing. Go back to your old program (but fix the mistakes I marked wrong!). You should have small code for your main program. Lots of logic in your class.
  • You must write the code to support the class, no inheritance yet!
  • Ensure you work through (in order) and show me your:
    • GUI Design
    • Class diagram for each of your classes (you may have 1 or more classes)
    • Flow-chart for every method in your class
  • To get a 4+ you can do it in another language or :
    • Use message box (Yes or No) to ask if the user wants the third card
    • “Click” on the computers cards to turn them over
    • Have the user start with an amount of money and let them bet some each round. If they win, their bet amount doubles. Let them keep playing until they run out of money
    • Have more than one deck of cards!
    • Have an option to make an Ace 11 or 1!
  • See Marking Rubric below
  • Ensure you work through (in order):
    • GUI Design
    • Top-down (always only 1)
    • Class Diagram(s)
    • Flow-chart (1 for each method)
    • Pseudo-code (you do not need to do it anymore!)
    • Final, debugged, commented code
    • GitHub 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, Class Diagram(s) and Flow-chart(s)
      • 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 are to be included and stating that you have included them
      • Design Document(s):
        • this includes GUI Design, Top-down, Class Diagram(s) 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:
        • screen shots of your running program
        • you will include a screen shot 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
        • URL to your repo
      • 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