Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use at least one array defined in your code and two array lists defined by the operation of your code. The array should be 52

Use at least one array defined in your code and two array lists defined by the operation of your code. The array should be 52 elements and contain a representation of a standard deck of cards, in new deck order. (This is the order of a deck of cards new from the box.)

The 2 Array lists can be looked at as a draw deck and a hand deck. The original array is used to populate the draw deck before dealing.

  • Write and use a method to build a deck of cards where the array of cards is available in Main.
  • Use the clear screen method given in class, clear the screen when your program runs. (available on the class web page in myControls.java
  • Use heading or titles and make the output look nice.
  • Back in Main, print out the cards, 4 per line, 1 suit per column. (using a loop might help)
  • Use the deck array to create an array list of cards and be able to shuffle those cards.
  • Print out the shuffled deck.
  • Deal out 5 cards to another array list and the remaining cards should be the draw pile. (you will be taking cards from one ArrayList and adding it to another.)
  • Print both the hand (5 cards) and the draw deck (47 cards).
public static void cls() { if (System.getProperty("os.name").contains("Mac")) { System.out.println("\033[H\033[2J"); }else{ try { new ProcessBuilder("cmd","/c","cls").inheritIO().start().waitFor(); } catch(Exception e) { System.out.println("Error?"); }//end try }//end if }// cls

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

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions

Question

6. Discuss the transformation of the HRM function.

Answered: 1 week ago

Question

4. Describe cultural differences that influence perception

Answered: 1 week ago