Create the classes war card deck listnode and queue

Assignment Help JAVA Programming
Reference no: EM131274415

Assignment Number:

Folder Name: LinkedWar

Create the classes War, Card, Deck, ListNode, Queue, LinkedQueue, and EmptyStructureException to play War. These classes can be found in the textbook: Data Structures and Algorithms in Java by Peter Drake on pp. 108-113, 120-124, 159, and 166.

Make the following modifications to War

1. The highest card is an Ace and the lowest card is a Two.

2. Use a linked representation for the Queue using the classes

ListNode and LinkedQueue.

3. Change stack1 and stack2 in War.java to queue1 and queue2.

There will be no Stack and LinkedStack in War.

4. The queues in the program are really pseudoqueues. To access the
rear of the queue, using a new queue method like peek or getLastElement, to get the last element put in the queue to determine who wins the round.

5. Add a counter to print the Round Number and to print how many cards are in each player's hand. Add a size variable to the LinkedQueue and a LinkedQueue method getSize which return the size of the queue.

6. In the Deck class, instead of initializing the cards array with nested for loops and then shuffling the deck, read the cards in from a file in your War folder called "Cards". The Cards file will have 52 lines (one for each card) and each line will contain 2 characters like Ad, 2c, Js, 9d, etc. Translate the characters to rank and suit and put them in the cards array. Use the FileInputOutput class as an example how to do I/O from files.

7. The dialog of the game will look something like this.

Reference no: EM131274415

Questions Cloud

How they fit into the shopping activities of local residents : A telephone survey has been conducted to identify strengths and weaknesses of these areas and to find out how they fit into the shopping activities of local residents.
Did employees have an expectation of privacy : Did Arch Wireless violate privacy laws by providing transcripts to the city? Did employees have an expectation of privacy in their messages?
Identify the audience you wish to target : Briefly describe and justify the theory in which you will use to support your campaign, Explain the initial methods you plan to use to create your public health campaign and explain why you selected those methods and Briefly describe your goals for ..
What are the advantages of using ceramic-matrix composites : What are the principle advantages of the Arall material compared with those of unreinforced aluminum?
Create the classes war card deck listnode and queue : Create the classes War, Card, Deck, ListNode, Queue, LinkedQueue, and EmptyStructureException to play War. These classes can be found in the textbook.
Determine the right person for the job : For this assignment, you should create a plan to hire an employee for a position within your organization to support a recent change. In this plan, you should include the following:
The complaint asserting that the communications decency act : MySpace sought to dismiss the complaint, asserting that the Communications Decency Act immunizes the company from liability. What was the result?
Relationship between ethics and the law : Look at the relationship between ethics and the law and suggest why some companies opt to behave illegally and what may lead them to engage in illegal activities.
Give sample code to implement the fibonacci series : You approach others in your department about the possibility of using recursion, and a few of them are not familiar with how it works. Describe recursion and give sample code to implement the Fibonacci Series.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd