Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm to create a blackjack game in java using the following two classes. import java.util.Random; /** * * @author user */ public class DeckOfCards {

I'm to create a blackjack game in java using the following two classes.

import java.util.Random; /** * * @author user */ public class DeckOfCards {

private Card[] deck; private int currentcard; private static final int Number_of_Cards = 52; private static final Random randomnumbers = new Random(); public DeckOfCards() { String[] faces = {"Ace", "Deuce", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"}; String[] suits = {"Hearts", "Diamonds", "Clubs", "Spades"}; deck = new Card[Number_of_Cards]; currentcard = 0; for( int count= 0; count < deck.length; count++) { deck[count] = new Card(faces[count%13], suits[count/13]); } } public void shuffle() { currentcard = 0; for(int first = 9; first

and

public class Card { public String face; public String suit; public Card(String cardface, String cardsuit) { face = cardface; suit = cardsuit; } public String toString() { return face + "of" + suit; } }

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

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions