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

  Create a program that has an object type of contact

Create a program that has an object type of Contact. This contact will need to have the following attributes: Name, Birth Date, Phone Number, Address and Eye Color

  Write a statement that prints the number of characters

Write a statement that prints the number of characters in a String object called myString. Write statements to prompt for and read user's age using Scanner variable

  Write program that uses a class named rectangle

Write program that uses a class named Rectangle. The class has floating point attributes length and width. it has member functions that calculate the perimeter and area of the rectangle. It also has set and get functions for both length and width.

  Program of javascript

Black Dot Printing is attempting to organize carpools to save energy. Each input record contains an employee's name and town of //residence.

  Using notepad that implements a basic text analyzer

Write a Java application using Notepad that implements a basic Text Analyzer.

  Write a java program that (1) defines a base/super class a

Write a Java program that (1) Defines a base/super class A, a subclass B (inherits from A), and a subclass C (inherits from B). The A class must have a method f() which is not implemented in A,

  Create an employee class

Create an Employee class. Items to include as data members are employee number, name, data of hire, job description, department, and monthly salary. The class is often used to display an alphabetical listing of all employs.

  Java program to find a value at in index

Construct a main class named Array Program that generates an array of 50-integers, all ranging from one to one hundred.

  Digital image processing using java

Digital image processing using java ..create plugin using Jedit and run it in imageJ

  Write a program in which a ball is released

Write a program in which a ball is released from a user-defined height and free-falls to the ground. The ball is pulled by earth's gravity of 9.8 m/sec 2 . Assume that each pixel represents 1 cm. Once the ball hits the ground

  Write a program to recognise the contour of an image

I think there are only small changes to be made, and I would be very grateful if you could show me what to change so that it works properly.

  Your taskbullthe auction system should allow the user to

your taskbullthe auction system should allow the user to participate in a number of items and for the user to be able

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