Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Anyone can help me in this code to run this?? please send your code. import java.util.LinkedList; import java.util.Collections; import java.util.Iterator; /** * Instances of this

Anyone can help me in this code to run this?? please send your code.

import java.util.LinkedList; import java.util.Collections; import java.util.Iterator; /** * Instances of this class represent a * deck of cards * * @author francis dc * @version 1.1 */ public class Deck { private static final int NUM = 3; // Number of cards in Deck private Card[] cards;

private int squares; public RelativeMovementCard(String description, int squares) { super(description); this.squares = squares; }

private int amount; public PayBankCard(String description, int amount) { super(description); }

public Deck(); { cards = new Card[NUM]; cards[0] = new RelativeMovementCard("Go back 3 spaces", -3); cards[1] = new PayBankCard("Pay poor tax $15", 15); cards[2] = new PayBankCard("Pay school tax of $150", 150); }

public void save() { for (int i = 0; i < cards.length; i++) cards[i].save(); } public void pickCard() { Card card; card = cards[0]; card.execute(); // shuffle the other cards to the front and // add the current card to the end of the deck // }

public static void main(String[] args) { Deck deck; deck = new Deck(); deck.pickCard(); deck.pickCard(); } }

because there are error ni the code

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions