Day 3: Object Oriented Programming

Practice

Implement the following Java program:

Create a Cards Game structure using Java:

Classes:

  • Game:

    • name: String

    • players: Player[]

  • Player:

    • name: String

    • score: int

    • cards: Card[]

  • Card:

    • number: int

    • type: CardType

  • CardType

    • enum: HEARTS, SPADES, DIAMONDS, CLUBS

Logic:

  • Input the game name from user

  • Input player names from user

  • Shuffle and distribute deck of cards on the four players

  • Print the Game info:

    • Game Name

    • Player Names

    • The cards in with each player, including number and type

Upload your work to Git.