Problem#2 (Game: pick four cards) Write a program which creates a deck of cards of 52 and pick any four cards by randomly. After that add the total values of four cards if the total is less than or...


Problem#2<br>(Game: pick four cards) Write a program which creates a deck of cards of 52 and pick any four<br>cards by randomly. After that add the total values of four cards if the total is less than or equal to<br>21 print out

Extracted text: Problem#2 (Game: pick four cards) Write a program which creates a deck of cards of 52 and pick any four cards by randomly. After that add the total values of four cards if the total is less than or equal to 21 print out "You are lucky!" to the console else print out “Not too bad!" to the console. (Hint: use the modules operator to get the card value, Ace is 1, Jack is 11, Queen is 12 and King is 13) Use these two String array to create a Deck: String suit = {"Spades", "Heart", "Club", "Diamond"}; String [] rank = {"Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"}; Output: Diamond Six Diamond Eight Spades Three Diamond Ace Total value is 18 You are lucky!

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here