Question: import java.util.*; public class PoD { public static void main( String [] args ) { Scanner in = new Scanner( System.in ); LinkedList cardDeck =

![[] args ) { Scanner in = new Scanner( System.in ); LinkedList](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f31fe0bc9db_44066f31fe05f296.jpg)
import java.util.*; public class PoD { public static void main( String [] args ) { Scanner in = new Scanner( System.in ); LinkedList cardDeck = new LinkedList(); // START WORK HERE **************************************************** /* Build a card deck by placing cards based on NUMBER_OF_MOVES lines of input: 1. If input is of the form: TOP,9 Spades insert "9 Spades" on the top of the deck 2. If input is of the form: BOTTOM,5 Diamonds insert "5 Diamonds" at the bottom of the deck 3. If input is of the form "TAKE,top" or "TAKE,bottom" then remove a card from the top or bottom, respectively, of the deck. */ final int NUMBER_OF_MOVES = Integer.parseInt(in.nextLine()); // END WORK HERE **************************************************** System.out.println(cardDeck); in.close(); System.out.print("END OF OUTPUT"); } } Today you are going to use a LinkedList to build a deck of cards. The linked list cardDeck has been declared for you. Now you must fill the card deck with cards as described below Details Download the ZIP files named FilesNeeded.zip for use in IntelliJ. When you are happy with your solution, upload the files into the src folder and run. You are going to finish off PoD.java to finish building the card deck. Input Input consists first of an integer number of moves needed to build the card deck (read in for you). Following that, moves will be of the form below I. If input is of the form TOP,9 Spades. insert Spades on the top of the deck 2. If input is of the form: BOTTOM,5 Diamonds. insert "5 Diamonds at the bottom of the deck 3. If input is of the form TAKE, top or TAKE,bottom, then remove a card from the top or bottom, respectively, of the deck. Processing For each line of input, you should add cards to the card deck as described Output Output will be handled for you and will display the contents of the card deck
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
