Instructions: For this activity, you will be creating the start of a card game managing application. The exact game or theme is completely up to your creative mind, or feel free to use a pre-existing...


Instructions:


For this activity, you will be creating the start of a card game managing application. The exact game or theme is completely up to your creative mind, or feel free to use a pre-existing game (e.g. Go-Fish, Crazy-Eights, Uno, etc...).


The program will feature a dealer and unlimited players. The dealer manages the player’s at the table, the deck of cards, and the dealing of cards to the players. The user creates the cards for the deck, and issues commands to the dealer.


Class Data



  • Card

    • Name (Text)

    • Description (Text)

    • Value (Fractional Number)



  • Player

    • Name (Text)

    • Chip Count (Whole Number)

    • Hand of Cards (List of “Card” class objects)



  • Dealer

    • Name (Text)

    • Years of Experience (Whole Number)

    • Deck of Cards (List of “Card” class objects)

    • Players at Table (Dictionary of player objects)

      • Key: The chair name (Text)

        • Think of this as the player’s location at the table.

        • Example: “Chair 1”



      • Value: Player class type

        • References new Player class object instances








Dictionary and List Usage



  • List

    • New cards are added to the dealer’s deck.






    • When a card is dealt to a player it is removed from the deck and added to the selected player’s hand-of-cards.

    • When a card is discarded from a player’s hand it is added back to the dealer’s deck.


  • Dictionary

    • Contains the players at the table, and is used to access the different player’s individual hands-of-cards.

    • Each player is accessed by their seating arrangement (i.e. the name of their location at the table or seat name).




Program



  • A Dealer class variable to reference the currently hired dealer object instance.

    • This is expected to be null until the user selects the appropriate menu option.



  • Application runs until the user chooses to exit.


Menu



  • Hire Dealer

    • Creates a new Dealer object for the program to reference.

      • All other menu options work through that reference.



    • A previous dealer, player(s), and the cards donotneed to be transferred.



  • Invite Player

    • Request input necessary to create a new Player object instance.

    • Request which location (seat) at the table the player should sit at.

      • Display a user-friendly message if another player is already sitting at that location.



    • Add the player to the dealer’s dictionary.



  • Create Card

    • Request input necessary to create a new Card object instance.

    • Add it to the current dealer’s deck.

    • Display a user-friendly message if the dealer has not been hired.



  • Deal Card

    • Request which player should receive a card.

      • Allow the user to select by either index or by key.

      • Display a user-friendly message if no players are present.



    • Request which card from the deck should be dealt.

      • Allow the user to select by index.

      • Display a user-friendly message if no cards are present.



    • Remove the selected card from the deck.

    • Add the selected card to the selected player’s hand-of-cards.



  • Play Card

    • Request which player is about to play a card.

      • Allow the user to select by either index or by key.

      • Display a user-friendly message if no players are present.



    • Request which card from their hand should be played.

      • Allow the user to select by index.

      • Display a user-friendly message if no cards are present.

      • Move the card from the player’s hand back to the dealer’s deck.





  • Display Hand

    • Request which player should be displayed.

      • Allow the user to select by either index or by key.

      • Display a user-friendly message if no players are present.



    • Display the selected player’s details.

    • Display the details of each card object in the player’s hand-of-cards.



  • Display All

    • Display the dealer’s information.

    • Display each player’s information.

      • Under each player’s info, display the details of their cards.





  • Exit - stop the program.


Input Validation



  • User’s input must be validated

  • The user must not be able to crash your program by entering invalid input

Mar 08, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here