Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve following assignment using basic java data structure fundamentals. Please provide comments for all programming so that I can reference them for my learning

Please solve following assignment using basic java data structure fundamentals. Please provide comments for all programming so that I can reference them for my learning which will help me program this assignment on my own.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

STARTER CODE:

LinkedStack.java:

image text in transcribed

Main.java:

image text in transcribed

Stack Interface (Stack.java)

image text in transcribed

We have already used the stack ADT to design a test program. Since ADT's are not concerned about HOW the inner workings are designed and implemented, if we use the same interface, we should be able to use the same exact code for the test cases we developed for the previous assignment if we re-declare all the objects used to a different implementation of the stack ADT that uses linked nodes instead. The stack ADT can also be leveraged to greatly simplify any program that requires a collection of items where operations only occur on one end. It is a great ADT choice simulating any card game where you have a collection of cards that uses a first in, first out behavior. this assignment, you will be responsible for two parts - Part 1: implement your own version of the stack ADT using linked nodes. Implement all necessary public methods according to the interface. Additionally, override the tostring method. - Part 2: design and implement a simple pokemon card game. - In the game, the player gets 10 random cards and the computer gets random 10 cards - which are then stored in stacks. - Each card's information should be imported from the pokemon.csv file. - In each round, the player and computer's top card in the stack will be compared. - If the player's pokemon's attack value is greater than the computer's pokemon's defense value, then player wins the round and gets a point. - At the end of the 10 rounds, display how many points the player earned. ample output: The sample output has no user interaction at all. Round \#: 1 Player: Pokemon { name='Mime Jr.', attack =25, defense =45} Computer: Pokemon { name='Smeargle', attack =20, defense =35} \#\#\#\#\# fight! \#\#\#\#\#\# Computer wins this round. Round \#: 2 Player: Pokemon { name='Conkeldurr', attack =140, defense =95. Computer: Pokemon { name='Throh', attack =100, defense =85} \#\#\#\#\# fight! \#\#\#\#\#\# Player wins this round. Round \#: 3 Player: Pokemon { name='Skorupi', attack =50, defense =90} Computer: Pokemon { name='Chikorita', attack =49, defense =65. \#\#\#\#\# fight! \#\#\#\#\#\# Computer wins this round. Round \#: 4 Player: Pokemon { name='Entei', attack=115, defense =85} Computer: Pokemon { name='Steelix', attack =85, defense =200} \#\#\#\#\# fight! \#\#\#\#\#\# Computer wins this round. Round \#: 5 Player: Pokemon { name='Clefable', attack =70, defense =73} Computer: Pokemon { name=' Omanyte', attack =40, defense =100} \#\#\#\#\# fight! \#\#\#\#\#\# Computer wins this round. Round \#: 6 Player: Pokemon { name= 'Gallade', attack =125, defense =65} Computer: Pokemon { name= 'Sandslash', attack =100, defense =110} \#\#\#\#\# fight! \#\#\#\#\#\# Player wins this round. Round \#: 7 Player: Pokemon { name= 'Gliscor', attack =95, defense =125} Computer: Pokemon { name = 'Slowbro', attack =75, defense =110} \#\#\#\#\# fight! \#\#\#\#\#\# Computer wins this round. Round \#: 8 Player: Pokemon\{name= 'AltariaMega Altaria', attack=110, defense=110 } Computer: Pokemon { name='Eelektross', attack=115, defense =80} \#\#\#\#\# fight! \#\#\#\#\#\# Player wins this round. Round \#: 9 Player: Pokemon { name= 'Ledian ', attack=35, defense =50} Computer: Pokemon { name='Wailmer', attack =70, defense =35} \#\#\#\#\# fight! \#\#\#\#\#\# It's a tie! Round \#: 10 Player: Pokemon { name= 'Sealeo', attack=60, defense=70 Computer: Pokemon { name= 'Gardevoir', attack =65, defense =65} \#\#\#\#\# fight! \#\#\#\#\#\# Computer wins this round. The battle has come to an end. Player score is: 3 Process finished with exit code oublic interface stack { / Adds a new entry to the top of this stack. * * eparam item An object to be added to the stack. * @throws IllegalstateException - if the element cannot be added at this time due to capacity restrictions 8/ public void push(T item) throws IllegalstateException

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

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

=+Is this metric really applicable to what I want to accomplish?

Answered: 1 week ago

Question

=+How does this metric connect to my objectives?

Answered: 1 week ago