Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

creat a program that simulates a deck of playing cards. A card is represented as having value from 1 to ooo Sprint F 6:41 PM

creat a program that simulates a deck of playing cards. A card is represented as having value from 1 to
image text in transcribed
ooo Sprint F 6:41 PM 34% randomlyphilled.org Part 1 (15 points) Create a program that simulates a deck of playing cards. Your program should be able to support the following: )A card is represented as having a value from 1 through 9 and a color represented as Red, Yellow, Green and Blue. For example, one card is Green 5 20A deck of cards contains all possible combinations of cards. Each deck should have 36 cards (9 different numeric values times 4 different colors) 3)The 36 cards in the deck can be "shuffled" meaning the cards are rearranged in some random order in the deck 4A deck can be shuffled and the deck contents can be printed on the screen at any time Program requirements: You must use an array to represent the deck of cards. You can do this by using numbers to represent the color and number sets. For example, if you designed red to be set 1 (number values 1-9) and green to be set 2 (number values 10-18), a Red 3" would have a value of 3 while a "Green 4 would have a value of 13. This allows you to have a unique numeric value representing each one of the 36 possible cards. The program must be interactive in allowing the user to do at the following from a main menu: a. Show all the cards in the deck Shuffle the cards c Exit the program When you start, the cards should be in a specific order of your choosing in the array. If the user says to show all the cards, the program goes through the array and prints each card translating the numeric representation stored in the array (such as a value of 3) into an appropriate print out (Red 3") All cards in the deck should be shown on the screen in the current order they are stored in the array 4) If the users says to shuffle the cards, the array contents are randomly shuffled. When this is complete, the user should be able to see the shuffled contents by selecting the "Show all cards" option from the main menu s The user must be able to freely choose between shuffling and showing the cards at any time from the main menu until they select exit Scoring 5 points -correct array representation of the deck of cards 5 points correct shuffling function 5 points correct ability to print the deck of cards on the screen and proper user interaction to shuffle and print any time the user chooses

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

=+such as the dirigenti in Italy?

Answered: 1 week ago

Question

=+ Are there closed-shop requirements or practices?

Answered: 1 week ago