Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that allows the user to play the card game flip. Flip is played

ID: 3665726 • Letter: W

Question

Write a program that allows the user to play the card game flip. Flip is played by one player with a standard deck of 52 cards. The game has the following steps: The cards are shuffled three times. The player draws 24 cards from the top of the deck, without looking at them, and places them face down on the table. The player can either select a card to turn over, or end the game. If a card is turned over, the player: receives 10 points for an ace, receives 5 points for a king, queen or jack, receives 0 points for an 8, 9, or 10, loses half their points for a 7, loses all their points for a 2, 3, 4, 5 or 6, and receives 1 point extra, in addition to the above, for a heart. The goal is to end the game with the most points. Fully implement a card class that stores a single card. A card includes a value and a suit (club, diamond, heart or spade). The class should at least include (1) a construtor, (2) setValue() and setSuit() functions, (3) getValue() and getSuit() functions, and (4) an overloaded

Explanation / Answer

You are flipping all cards when mouse button is pressed. You have to check if the mouse position is intersecting the card and the mouse is pressed, if so, flip that card. Make methods mouseX() and mouseY() which gives you mouse coordinates. And just add if(mouse position is intersecting the card):

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote