Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Project - Stacks & Queues Part 1 - Implementing a Stack and a Queue 1) Download Project6Starter.zip and copy the files into an Eclipse

Programming Project - Stacks & Queues

Part 1 - Implementing a Stack and a Queue

1) Download Project6Starter.zip and copy the files into an Eclipse project. Note that you should not modify the package structure of the project and the LInkedStack and LinkedQueue classes must remain in the jsjf package.

2) Complete the implementation of the LinkedStack & LinkedQueue classes in the jsjf package.

3) Your code should work with the provided sample test driver without modification. You should make sure your code is correct by performing additional tests - the test driver may not cover all the cases that will be tested when you submit your code.

4) Create a driver class called Project6.java that demonstrates that all LinkedStack & LinkedQueue methods work correctly.

Part 2 - Stack & Queue Application - Card game

1) Write a class called StackHand which implements the HandOfCards interface using the LinkedStack class from the jsjf package. Include the following methods:

play() which removes a card from the hand and returns the card

size() which returns the number of cards in the hand

2) In a separate driver class called WarGame, deal 2 StackHands of cards. The hands should have the same number of cards.

A. Play a game of war with the two hands. Deal the top card. The player with the highest value card gets a point.

B. When the hands are empty, print the score for each player.

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

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions

Question

(1 point) Calculate 3 sin x cos x dx.

Answered: 1 week ago

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

=+ What topics are contained in the contracts?

Answered: 1 week ago