SlideShare a Scribd company logo
Complete in Java
CardApp.java
public class CardApp {
private LinkedList list;
/**
* User interface prompts user, reads and writes files.
*/
public static void main(String[] args) {
}
/**
* Default constructor to initialize the deck
*/
public CardApp() {
}
/**
* Inserts a new Card into the deck
* @param card a playing Card
*/
public void addCard(Card card) {
}
/**
* Shuffles cards following this algorithm:
* First swaps first and last card
* Next, swaps every even card with the card 3
* nodes away from that card. Stops when it
* reaches the 3rd to last node
* Then, swaps ALL cards with the card that is
* 2 nodes away from it, starting at the 2nd card
* and stopping stopping at the 3rd to last node
*/
public void shuffle() {
}
/**
* Implements the bubble sort algorithm
* to sort cardList into sorted order, first by suit
* (alphabetical order)
* then by rank from 2 to A
*/
public void sort() {
}
/**
* Returns the deck of cards with each card separated
* by a blank space and a new line character at the end.
* @return The deck of cards as a string.
*/
@Override public String toString() {
return "";
}
}
Card.java
public class Card implements Comparable{
private String rank;
private String suit;
/**
* Constructor for the Card class
* @param rank the rank of card from 2 to A
* @param suit the suit of card C, D, H, or S
*/
public Card(String rank, String suit) {
}
/**
* Returns the card's rank
* @return rank a rank from 2 (low) to A (high)
*/
public String getRank() {
return "";
}
/**
* Returns the card's suit
* @return C, D, H, or S
*/
public String getSuit() {
return "";
}
/**
* Updates the card's rank
* @param rank a new rank
*/
public void setRank(String rank) {
}
/**
* Updates the card's suit
* @param suit the new suit
*/
public void setSuit(String suit) {
}
/**
* Concatenates rank and suit
* @return card rank and suit
*/
@Override public String toString() {
return "";
}
/**
* Overrides the equals method for Card
* Compares rank and suit and
* follows the equals formula given in
* Lesson 4 and also in Joshua Block's text
* @param obj another Object to compare for
* equality
* @return whether obj is a Card and, if so,
* of equal rank and suit
*/
@Override public boolean equals(Object obj) {
return false;
}
/**
* Orders two cards first by suit (alphabetically)
* Next by rank. "A" is considered the high card
* Order goes 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A
* @param card another Card to compare to this Card
* @return a negative number if this comes before c
* and a positive number if c comes before this
* and 0 if this and c are equal according to the above
* equals method
*/
@Override public int compareTo(Card card) {
return -1;
}
}
}
LinkedList.Java
import java.util.NoSuchElementException;
public class LinkedList {
private class Node {
private T data;
private Node next;
private Node prev;
public Node(T data) {
this.data = data;
this.next = null;
this.prev = null;
}
}
private int length;
private Node first;
private Node last;
private Node iterator;
/**** CONSTRUCTORS ****/
/**
* Instantiates a new LinkedList with default values
* @postcondition
*/
public LinkedList() {
}
/**
* Converts the given array into a LinkedList
* @param array the array of values to insert into this LinkedList
* @postcondition
*/
public LinkedList(T[] array) {
}
/**
* Instantiates a new LinkedList by copying another List
* @param original the LinkedList to copy
* @postcondition a new List object, which is an identical,
* but separate, copy of the LinkedList original
*/
public LinkedList(LinkedList original) {
}
/**** ACCESSORS ****/
/**
* Returns the value stored in the first node
* @precondition
* @return the value stored at node first
* @throws NoSuchElementException
*/
public T getFirst() throws NoSuchElementException {
return null;
}
/**
* Returns the value stored in the last node
* @precondition
* @return the value stored in the node last
* @throws NoSuchElementException
*/
public T getLast() throws NoSuchElementException {
return null;
}
/**
* Returns the data stored in the iterator node
* @precondition
* @return the data stored in the iterator node
* @throw NullPointerException
*/
public T getIterator() throws NullPointerException {
return null;
}
/**
* Returns the current length of the LinkedList
* @return the length of the LinkedList from 0 to n
*/
public int getLength() {
return -1;
}
/**
* Returns whether the LinkedList is currently empty
* @return whether the LinkedList is empty
*/
public boolean isEmpty() {
return false;
}
/**
* Returns whether the iterator is offEnd, i.e. null
* @return whether the iterator is null
*/
public boolean offEnd() {
return false;
}
/**** MUTATORS ****/
/**
* Creates a new first element
* @param data the data to insert at the front of the LinkedList
* @postcondition
*/
public void addFirst(T data) {
return;
}
/**
* Creates a new last element
* @param data the data to insert at the end of the LinkedList
* @postcondition
*/
public void addLast(T data) {
return;
}
/**
* Inserts a new element after the iterator
* @param data the data to insert
* @precondition
* @throws NullPointerException
*/
public void addIterator(T data) throws NullPointerException{
return;
}
/**
* removes the element at the front of the LinkedList
* @precondition
* @postcondition
* @throws NoSuchElementException
*/
public void removeFirst() throws NoSuchElementException {
return;
}
/**
* removes the element at the end of the LinkedList
* @precondition
* @postcondition
* @throws NoSuchElementException
*/
public void removeLast() throws NoSuchElementException {
return;
}
/**
* removes the element referenced by the iterator
* @precondition
* @postcondition
* @throws NullPointerException
*/
public void removeIterator() throws NullPointerException {
}
/**
* places the iterator at the first node
* @postcondition
*/
public void positionIterator(){
}
/**
* Moves the iterator one node towards the last
* @precondition
* @postcondition
* @throws NullPointerException
*/
public void advanceIterator() throws NullPointerException {
}
/**
* Moves the iterator one node towards the first
* @precondition
* @postcondition
* @throws NullPointerException
*/
public void reverseIterator() throws NullPointerException {
}
/**** ADDITIONAL OPERATIONS ****/
/**
* Re-sets LinkedList to empty as if the
* default constructor had just been called
*/
public void clear() {
}
/**
* Converts the LinkedList to a String, with each value separated by a
* blank space. At the end of the String, place a new line character.
* @return the LinkedList as a String
*/
@Override
public String toString() {
return "n";
}
/**
* Determines whether the given Object is
* another LinkedList, containing
* the same data in the same order
* @param obj another Object
* @return whether there is equality
*/
@SuppressWarnings("unchecked") //good practice to remove warning here
@Override public boolean equals(Object obj) {
return false;
}
/**CHALLENGE METHODS*/
/**
* Moves all nodes in the list towards the end
* of the list the number of times specified
* Any node that falls off the end of the list as it
* moves forward will be placed the front of the list
* For example: [1, 2, 3, 4, 5], numMoves = 2 -> [4, 5, 1, 2 ,3]
* For example: [1, 2, 3, 4, 5], numMoves = 4 -> [2, 3, 4, 5, 1]
* For example: [1, 2, 3, 4, 5], numMoves = 7 -> [4, 5, 1, 2 ,3]
* @param numMoves the number of times to move each node.
* @precondition numMoves >= 0
* @postcondition iterator position unchanged (i.e. still referencing
* the same node in the list, regardless of new location of Node)
* @throws IllegalArgumentException when numMoves < 0
*/
public void spinList(int numMoves) throws IllegalArgumentException{
}
/**
* Splices together two LinkedLists to create a third List
* which contains alternating values from this list
* and the given parameter
* For example: [1,2,3] and [4,5,6] -> [1,4,2,5,3,6]
* For example: [1, 2, 3, 4] and [5, 6] -> [1, 5, 2, 6, 3, 4]
* For example: [1, 2] and [3, 4, 5, 6] -> [1, 3, 2, 4, 5, 6]
* @param list the second LinkedList
* @return a new LinkedList, which is the result of
* interlocking this and list
* @postcondition this and list are unchanged
*/
public LinkedList altLists(LinkedList list) {
return null;
}
}
In this lab, we will write an application to store a deck of cards in a linked list, and then write
methods to sort and shuffle the deck. Step 1: Copy your LinkedList Copy your completed
LinkedList class from Lab 4 into the LinkedList. java file below. Step 2: Implement the methods
of the card class Complete all methods of the Card class as described by the Javadoc comments.
The class contains both a suit and a rank. A suit is one of the categories into which the cards of a
deck are divided. The rank is the relative importance of the card within its suit. Note that the
Card constructor must convert any rank and suit letters to uppercase. For the equals () method, be
sure to follow the steps outlined in Lesson 4. How to implement the compareTo() method is also
covered in Lesson 4. Note that you are not allowed to add any additional methods or member
variables to this class or you will not receive credit for this assignment. Step 3: Implement the
methods of the CardApp class Complete all methods of the CardApp class in the CardApp. java
file as described by the Javadoc comments. You may add as many methods as you would like to
this file, but are not allowed to add any additional member variables. The CardApp program
must prompt for and allow the user to enter the name of any input file as shown in the Example
output below. Enter the name of a file containing a deck of cards: cardsl.txt Please open
shuffled.txt and sorted.txt. Goodbye ! Implement the shuffle() method as specified in the
comments for shuffle(). After you have shuffled the deck of cards, write the result into a file
named shuffled. txt. Implement the sort() method using bubble sort from Lesson 4. First sort by
suit in alphabetical order and then by rank from 2 to A. The pseudocode for bubble sort is as
follows: for i=0 up to and including length -2 for j=0 up to and including length i2// each pass
make fewer comparisons if A[j]>A[j+1]A[j]<>A[j+1]//swap for i=0 up to and including length -
2 for j=0 up to and including length - i2 //each pass make fewer comparisons if
A[j]>A[j+1]A[j]>A[j+1]// swap After you have sorted the deck of cards, write the result to a file
named sorted. txt. The CardApp . java file also contains the main() method of the application.
Use Develop mode to test your CardApp code along with your Card and LinkedList code. All
input and output files must contain a list of cards, with each card stored on its own line. See the
example files cards1.txt and cards 2 . txt for example file formats.

More Related Content

Similar to Complete in JavaCardApp.javapublic class CardApp { private.pdf

Please help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdfPlease help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdf
seoagam1
 
Program 8 C++newproblems.txt12333142013KristinBrewer1032823.docx
Program 8 C++newproblems.txt12333142013KristinBrewer1032823.docxProgram 8 C++newproblems.txt12333142013KristinBrewer1032823.docx
Program 8 C++newproblems.txt12333142013KristinBrewer1032823.docx
wkyra78
 
Use C++ Write a function to merge two doubly linked lists. The input.pdf
Use C++ Write a function to merge two doubly linked lists. The input.pdfUse C++ Write a function to merge two doubly linked lists. The input.pdf
Use C++ Write a function to merge two doubly linked lists. The input.pdf
shalins6
 
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfProblem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
JamesPXNNewmanp
 
for initializer_list include ltinitializer_listgt .pdf
 for initializer_list include ltinitializer_listgt .pdf for initializer_list include ltinitializer_listgt .pdf
for initializer_list include ltinitializer_listgt .pdf
ajay1317
 
tested on eclipseDoublyLinkedList class.pdf
tested on eclipseDoublyLinkedList class.pdftested on eclipseDoublyLinkedList class.pdf
tested on eclipseDoublyLinkedList class.pdf
shanki7
 
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docxNew folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
curwenmichaela
 
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdfPlease do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
aioils
 
we using java code DynamicArrayjava Replace all .pdf
we using java code   DynamicArrayjava   Replace all .pdfwe using java code   DynamicArrayjava   Replace all .pdf
we using java code DynamicArrayjava Replace all .pdf
gudduraza28
 
Write the definition of the linkedListKeepLast function- (Please write.docx
Write the definition of the linkedListKeepLast function- (Please write.docxWrite the definition of the linkedListKeepLast function- (Please write.docx
Write the definition of the linkedListKeepLast function- (Please write.docx
delicecogupdyke
 
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdfHow do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
mail931892
 
please read below it will tell you what we are using L.pdf
please read below it will tell you what we are using   L.pdfplease read below it will tell you what we are using   L.pdf
please read below it will tell you what we are using L.pdf
ankit11134
 
package singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdfpackage singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdf
amazing2001
 
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
honey725342
 
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfProblem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
kingsandqueens3
 
student start_code_U08223_cwk1 (1).DS_Store__MACOSXstudent.docx
student start_code_U08223_cwk1 (1).DS_Store__MACOSXstudent.docxstudent start_code_U08223_cwk1 (1).DS_Store__MACOSXstudent.docx
student start_code_U08223_cwk1 (1).DS_Store__MACOSXstudent.docx
hanneloremccaffery
 
Describe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.pdfDescribe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.pdf
deepak596396
 
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdfNeed Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Edwardw5nSlaterl
 
Fix my codeCode.pdf
Fix my codeCode.pdfFix my codeCode.pdf
Fix my codeCode.pdf
Conint29
 
Please do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdfPlease do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdf
aioils
 

Similar to Complete in JavaCardApp.javapublic class CardApp { private.pdf (20)

Please help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdfPlease help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdf
 
Program 8 C++newproblems.txt12333142013KristinBrewer1032823.docx
Program 8 C++newproblems.txt12333142013KristinBrewer1032823.docxProgram 8 C++newproblems.txt12333142013KristinBrewer1032823.docx
Program 8 C++newproblems.txt12333142013KristinBrewer1032823.docx
 
Use C++ Write a function to merge two doubly linked lists. The input.pdf
Use C++ Write a function to merge two doubly linked lists. The input.pdfUse C++ Write a function to merge two doubly linked lists. The input.pdf
Use C++ Write a function to merge two doubly linked lists. The input.pdf
 
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfProblem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
 
for initializer_list include ltinitializer_listgt .pdf
 for initializer_list include ltinitializer_listgt .pdf for initializer_list include ltinitializer_listgt .pdf
for initializer_list include ltinitializer_listgt .pdf
 
tested on eclipseDoublyLinkedList class.pdf
tested on eclipseDoublyLinkedList class.pdftested on eclipseDoublyLinkedList class.pdf
tested on eclipseDoublyLinkedList class.pdf
 
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docxNew folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
 
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdfPlease do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
Please do Part A, Ill be really gratefulThe main.c is the skeleto.pdf
 
we using java code DynamicArrayjava Replace all .pdf
we using java code   DynamicArrayjava   Replace all .pdfwe using java code   DynamicArrayjava   Replace all .pdf
we using java code DynamicArrayjava Replace all .pdf
 
Write the definition of the linkedListKeepLast function- (Please write.docx
Write the definition of the linkedListKeepLast function- (Please write.docxWrite the definition of the linkedListKeepLast function- (Please write.docx
Write the definition of the linkedListKeepLast function- (Please write.docx
 
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdfHow do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
How do I fix it in LinkedList.javaLabProgram.javaLinkedList.jav.pdf
 
please read below it will tell you what we are using L.pdf
please read below it will tell you what we are using   L.pdfplease read below it will tell you what we are using   L.pdf
please read below it will tell you what we are using L.pdf
 
package singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdfpackage singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdf
 
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
 
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfProblem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
 
student start_code_U08223_cwk1 (1).DS_Store__MACOSXstudent.docx
student start_code_U08223_cwk1 (1).DS_Store__MACOSXstudent.docxstudent start_code_U08223_cwk1 (1).DS_Store__MACOSXstudent.docx
student start_code_U08223_cwk1 (1).DS_Store__MACOSXstudent.docx
 
Describe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.pdfDescribe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.pdf
 
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdfNeed Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
 
Fix my codeCode.pdf
Fix my codeCode.pdfFix my codeCode.pdf
Fix my codeCode.pdf
 
Please do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdfPlease do parts labeled TODO LinkedList.java Replace.pdf
Please do parts labeled TODO LinkedList.java Replace.pdf
 

More from MAYANKBANSAL1981

Business management 1. True or False Diversification is when compa.pdf
Business management  1. True or False Diversification is when compa.pdfBusiness management  1. True or False Diversification is when compa.pdf
Business management 1. True or False Diversification is when compa.pdf
MAYANKBANSAL1981
 
Change to oop formatimport java.util.Scanner;import java.io.;.pdf
Change to oop formatimport java.util.Scanner;import java.io.;.pdfChange to oop formatimport java.util.Scanner;import java.io.;.pdf
Change to oop formatimport java.util.Scanner;import java.io.;.pdf
MAYANKBANSAL1981
 
Case Project 2-1 Advance PreparationsThe IT managers from Chicago.pdf
Case Project 2-1 Advance PreparationsThe IT managers from Chicago.pdfCase Project 2-1 Advance PreparationsThe IT managers from Chicago.pdf
Case Project 2-1 Advance PreparationsThe IT managers from Chicago.pdf
MAYANKBANSAL1981
 
Can some one redo this code without the try-catch and an alternative.pdf
Can some one redo this code without the try-catch and an alternative.pdfCan some one redo this code without the try-catch and an alternative.pdf
Can some one redo this code without the try-catch and an alternative.pdf
MAYANKBANSAL1981
 
Banks are singled out for special attention in the financial sys.pdf
Banks are singled out for special attention in the financial sys.pdfBanks are singled out for special attention in the financial sys.pdf
Banks are singled out for special attention in the financial sys.pdf
MAYANKBANSAL1981
 
ASSETS LIABILITIES Cash $10,000 Accounts payable $12,000 Accounts re.pdf
ASSETS LIABILITIES Cash $10,000 Accounts payable $12,000 Accounts re.pdfASSETS LIABILITIES Cash $10,000 Accounts payable $12,000 Accounts re.pdf
ASSETS LIABILITIES Cash $10,000 Accounts payable $12,000 Accounts re.pdf
MAYANKBANSAL1981
 
A. Monitoring Internet Endpoints and Bandwidth Consumption1. NetFl.pdf
A. Monitoring Internet Endpoints and Bandwidth Consumption1. NetFl.pdfA. Monitoring Internet Endpoints and Bandwidth Consumption1. NetFl.pdf
A. Monitoring Internet Endpoints and Bandwidth Consumption1. NetFl.pdf
MAYANKBANSAL1981
 
About your clientName Samantha BensonAge 54Marital status .pdf
About your clientName Samantha BensonAge 54Marital status .pdfAbout your clientName Samantha BensonAge 54Marital status .pdf
About your clientName Samantha BensonAge 54Marital status .pdf
MAYANKBANSAL1981
 
About your clientName Samantha Benson Age 54 Marital status Ma.pdf
About your clientName Samantha Benson Age 54 Marital status Ma.pdfAbout your clientName Samantha Benson Age 54 Marital status Ma.pdf
About your clientName Samantha Benson Age 54 Marital status Ma.pdf
MAYANKBANSAL1981
 
a) Complete both insert and delete methods. If it works correctly 10.pdf
a) Complete both insert and delete methods. If it works correctly 10.pdfa) Complete both insert and delete methods. If it works correctly 10.pdf
a) Complete both insert and delete methods. If it works correctly 10.pdf
MAYANKBANSAL1981
 
About your client Name Samantha Benson Age 54 Marital status Ma.pdf
About your client Name Samantha Benson Age 54 Marital status Ma.pdfAbout your client Name Samantha Benson Age 54 Marital status Ma.pdf
About your client Name Samantha Benson Age 54 Marital status Ma.pdf
MAYANKBANSAL1981
 
About your client Name Samantha BensonAge 54Marital status.pdf
About your client Name Samantha BensonAge 54Marital status.pdfAbout your client Name Samantha BensonAge 54Marital status.pdf
About your client Name Samantha BensonAge 54Marital status.pdf
MAYANKBANSAL1981
 
Answer the following prompts 1The InstantRide Management team foun.pdf
Answer the following prompts 1The InstantRide Management team foun.pdfAnswer the following prompts 1The InstantRide Management team foun.pdf
Answer the following prompts 1The InstantRide Management team foun.pdf
MAYANKBANSAL1981
 
Advanced level school Python programming. Need helps. Thank.pdf
Advanced level school Python programming.  Need helps. Thank.pdfAdvanced level school Python programming.  Need helps. Thank.pdf
Advanced level school Python programming. Need helps. Thank.pdf
MAYANKBANSAL1981
 

More from MAYANKBANSAL1981 (14)

Business management 1. True or False Diversification is when compa.pdf
Business management  1. True or False Diversification is when compa.pdfBusiness management  1. True or False Diversification is when compa.pdf
Business management 1. True or False Diversification is when compa.pdf
 
Change to oop formatimport java.util.Scanner;import java.io.;.pdf
Change to oop formatimport java.util.Scanner;import java.io.;.pdfChange to oop formatimport java.util.Scanner;import java.io.;.pdf
Change to oop formatimport java.util.Scanner;import java.io.;.pdf
 
Case Project 2-1 Advance PreparationsThe IT managers from Chicago.pdf
Case Project 2-1 Advance PreparationsThe IT managers from Chicago.pdfCase Project 2-1 Advance PreparationsThe IT managers from Chicago.pdf
Case Project 2-1 Advance PreparationsThe IT managers from Chicago.pdf
 
Can some one redo this code without the try-catch and an alternative.pdf
Can some one redo this code without the try-catch and an alternative.pdfCan some one redo this code without the try-catch and an alternative.pdf
Can some one redo this code without the try-catch and an alternative.pdf
 
Banks are singled out for special attention in the financial sys.pdf
Banks are singled out for special attention in the financial sys.pdfBanks are singled out for special attention in the financial sys.pdf
Banks are singled out for special attention in the financial sys.pdf
 
ASSETS LIABILITIES Cash $10,000 Accounts payable $12,000 Accounts re.pdf
ASSETS LIABILITIES Cash $10,000 Accounts payable $12,000 Accounts re.pdfASSETS LIABILITIES Cash $10,000 Accounts payable $12,000 Accounts re.pdf
ASSETS LIABILITIES Cash $10,000 Accounts payable $12,000 Accounts re.pdf
 
A. Monitoring Internet Endpoints and Bandwidth Consumption1. NetFl.pdf
A. Monitoring Internet Endpoints and Bandwidth Consumption1. NetFl.pdfA. Monitoring Internet Endpoints and Bandwidth Consumption1. NetFl.pdf
A. Monitoring Internet Endpoints and Bandwidth Consumption1. NetFl.pdf
 
About your clientName Samantha BensonAge 54Marital status .pdf
About your clientName Samantha BensonAge 54Marital status .pdfAbout your clientName Samantha BensonAge 54Marital status .pdf
About your clientName Samantha BensonAge 54Marital status .pdf
 
About your clientName Samantha Benson Age 54 Marital status Ma.pdf
About your clientName Samantha Benson Age 54 Marital status Ma.pdfAbout your clientName Samantha Benson Age 54 Marital status Ma.pdf
About your clientName Samantha Benson Age 54 Marital status Ma.pdf
 
a) Complete both insert and delete methods. If it works correctly 10.pdf
a) Complete both insert and delete methods. If it works correctly 10.pdfa) Complete both insert and delete methods. If it works correctly 10.pdf
a) Complete both insert and delete methods. If it works correctly 10.pdf
 
About your client Name Samantha Benson Age 54 Marital status Ma.pdf
About your client Name Samantha Benson Age 54 Marital status Ma.pdfAbout your client Name Samantha Benson Age 54 Marital status Ma.pdf
About your client Name Samantha Benson Age 54 Marital status Ma.pdf
 
About your client Name Samantha BensonAge 54Marital status.pdf
About your client Name Samantha BensonAge 54Marital status.pdfAbout your client Name Samantha BensonAge 54Marital status.pdf
About your client Name Samantha BensonAge 54Marital status.pdf
 
Answer the following prompts 1The InstantRide Management team foun.pdf
Answer the following prompts 1The InstantRide Management team foun.pdfAnswer the following prompts 1The InstantRide Management team foun.pdf
Answer the following prompts 1The InstantRide Management team foun.pdf
 
Advanced level school Python programming. Need helps. Thank.pdf
Advanced level school Python programming.  Need helps. Thank.pdfAdvanced level school Python programming.  Need helps. Thank.pdf
Advanced level school Python programming. Need helps. Thank.pdf
 

Recently uploaded

MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 

Recently uploaded (20)

MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 

Complete in JavaCardApp.javapublic class CardApp { private.pdf

  • 1. Complete in Java CardApp.java public class CardApp { private LinkedList list; /** * User interface prompts user, reads and writes files. */ public static void main(String[] args) { } /** * Default constructor to initialize the deck */ public CardApp() { } /** * Inserts a new Card into the deck * @param card a playing Card */ public void addCard(Card card) { } /** * Shuffles cards following this algorithm: * First swaps first and last card * Next, swaps every even card with the card 3 * nodes away from that card. Stops when it * reaches the 3rd to last node * Then, swaps ALL cards with the card that is * 2 nodes away from it, starting at the 2nd card * and stopping stopping at the 3rd to last node */ public void shuffle() { } /** * Implements the bubble sort algorithm
  • 2. * to sort cardList into sorted order, first by suit * (alphabetical order) * then by rank from 2 to A */ public void sort() { } /** * Returns the deck of cards with each card separated * by a blank space and a new line character at the end. * @return The deck of cards as a string. */ @Override public String toString() { return ""; } } Card.java public class Card implements Comparable{ private String rank; private String suit; /** * Constructor for the Card class * @param rank the rank of card from 2 to A * @param suit the suit of card C, D, H, or S */ public Card(String rank, String suit) { } /** * Returns the card's rank * @return rank a rank from 2 (low) to A (high) */ public String getRank() { return ""; } /** * Returns the card's suit
  • 3. * @return C, D, H, or S */ public String getSuit() { return ""; } /** * Updates the card's rank * @param rank a new rank */ public void setRank(String rank) { } /** * Updates the card's suit * @param suit the new suit */ public void setSuit(String suit) { } /** * Concatenates rank and suit * @return card rank and suit */ @Override public String toString() { return ""; } /** * Overrides the equals method for Card * Compares rank and suit and * follows the equals formula given in * Lesson 4 and also in Joshua Block's text * @param obj another Object to compare for * equality * @return whether obj is a Card and, if so, * of equal rank and suit */ @Override public boolean equals(Object obj) { return false;
  • 4. } /** * Orders two cards first by suit (alphabetically) * Next by rank. "A" is considered the high card * Order goes 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A * @param card another Card to compare to this Card * @return a negative number if this comes before c * and a positive number if c comes before this * and 0 if this and c are equal according to the above * equals method */ @Override public int compareTo(Card card) { return -1; } } } LinkedList.Java import java.util.NoSuchElementException; public class LinkedList { private class Node { private T data; private Node next; private Node prev; public Node(T data) { this.data = data; this.next = null; this.prev = null; } } private int length; private Node first; private Node last; private Node iterator;
  • 5. /**** CONSTRUCTORS ****/ /** * Instantiates a new LinkedList with default values * @postcondition */ public LinkedList() { } /** * Converts the given array into a LinkedList * @param array the array of values to insert into this LinkedList * @postcondition */ public LinkedList(T[] array) { } /** * Instantiates a new LinkedList by copying another List * @param original the LinkedList to copy * @postcondition a new List object, which is an identical, * but separate, copy of the LinkedList original */ public LinkedList(LinkedList original) { } /**** ACCESSORS ****/ /** * Returns the value stored in the first node * @precondition * @return the value stored at node first * @throws NoSuchElementException */ public T getFirst() throws NoSuchElementException { return null; } /** * Returns the value stored in the last node * @precondition * @return the value stored in the node last
  • 6. * @throws NoSuchElementException */ public T getLast() throws NoSuchElementException { return null; } /** * Returns the data stored in the iterator node * @precondition * @return the data stored in the iterator node * @throw NullPointerException */ public T getIterator() throws NullPointerException { return null; } /** * Returns the current length of the LinkedList * @return the length of the LinkedList from 0 to n */ public int getLength() { return -1; } /** * Returns whether the LinkedList is currently empty * @return whether the LinkedList is empty */ public boolean isEmpty() { return false; } /** * Returns whether the iterator is offEnd, i.e. null * @return whether the iterator is null */ public boolean offEnd() { return false; } /**** MUTATORS ****/
  • 7. /** * Creates a new first element * @param data the data to insert at the front of the LinkedList * @postcondition */ public void addFirst(T data) { return; } /** * Creates a new last element * @param data the data to insert at the end of the LinkedList * @postcondition */ public void addLast(T data) { return; } /** * Inserts a new element after the iterator * @param data the data to insert * @precondition * @throws NullPointerException */ public void addIterator(T data) throws NullPointerException{ return; } /** * removes the element at the front of the LinkedList * @precondition * @postcondition * @throws NoSuchElementException */ public void removeFirst() throws NoSuchElementException { return; } /** * removes the element at the end of the LinkedList
  • 8. * @precondition * @postcondition * @throws NoSuchElementException */ public void removeLast() throws NoSuchElementException { return; } /** * removes the element referenced by the iterator * @precondition * @postcondition * @throws NullPointerException */ public void removeIterator() throws NullPointerException { } /** * places the iterator at the first node * @postcondition */ public void positionIterator(){ } /** * Moves the iterator one node towards the last * @precondition * @postcondition * @throws NullPointerException */ public void advanceIterator() throws NullPointerException { } /** * Moves the iterator one node towards the first * @precondition * @postcondition * @throws NullPointerException */ public void reverseIterator() throws NullPointerException {
  • 9. } /**** ADDITIONAL OPERATIONS ****/ /** * Re-sets LinkedList to empty as if the * default constructor had just been called */ public void clear() { } /** * Converts the LinkedList to a String, with each value separated by a * blank space. At the end of the String, place a new line character. * @return the LinkedList as a String */ @Override public String toString() { return "n"; } /** * Determines whether the given Object is * another LinkedList, containing * the same data in the same order * @param obj another Object * @return whether there is equality */ @SuppressWarnings("unchecked") //good practice to remove warning here @Override public boolean equals(Object obj) { return false; } /**CHALLENGE METHODS*/ /** * Moves all nodes in the list towards the end * of the list the number of times specified * Any node that falls off the end of the list as it * moves forward will be placed the front of the list * For example: [1, 2, 3, 4, 5], numMoves = 2 -> [4, 5, 1, 2 ,3] * For example: [1, 2, 3, 4, 5], numMoves = 4 -> [2, 3, 4, 5, 1]
  • 10. * For example: [1, 2, 3, 4, 5], numMoves = 7 -> [4, 5, 1, 2 ,3] * @param numMoves the number of times to move each node. * @precondition numMoves >= 0 * @postcondition iterator position unchanged (i.e. still referencing * the same node in the list, regardless of new location of Node) * @throws IllegalArgumentException when numMoves < 0 */ public void spinList(int numMoves) throws IllegalArgumentException{ } /** * Splices together two LinkedLists to create a third List * which contains alternating values from this list * and the given parameter * For example: [1,2,3] and [4,5,6] -> [1,4,2,5,3,6] * For example: [1, 2, 3, 4] and [5, 6] -> [1, 5, 2, 6, 3, 4] * For example: [1, 2] and [3, 4, 5, 6] -> [1, 3, 2, 4, 5, 6] * @param list the second LinkedList * @return a new LinkedList, which is the result of * interlocking this and list * @postcondition this and list are unchanged */ public LinkedList altLists(LinkedList list) { return null; } } In this lab, we will write an application to store a deck of cards in a linked list, and then write methods to sort and shuffle the deck. Step 1: Copy your LinkedList Copy your completed LinkedList class from Lab 4 into the LinkedList. java file below. Step 2: Implement the methods of the card class Complete all methods of the Card class as described by the Javadoc comments. The class contains both a suit and a rank. A suit is one of the categories into which the cards of a deck are divided. The rank is the relative importance of the card within its suit. Note that the Card constructor must convert any rank and suit letters to uppercase. For the equals () method, be
  • 11. sure to follow the steps outlined in Lesson 4. How to implement the compareTo() method is also covered in Lesson 4. Note that you are not allowed to add any additional methods or member variables to this class or you will not receive credit for this assignment. Step 3: Implement the methods of the CardApp class Complete all methods of the CardApp class in the CardApp. java file as described by the Javadoc comments. You may add as many methods as you would like to this file, but are not allowed to add any additional member variables. The CardApp program must prompt for and allow the user to enter the name of any input file as shown in the Example output below. Enter the name of a file containing a deck of cards: cardsl.txt Please open shuffled.txt and sorted.txt. Goodbye ! Implement the shuffle() method as specified in the comments for shuffle(). After you have shuffled the deck of cards, write the result into a file named shuffled. txt. Implement the sort() method using bubble sort from Lesson 4. First sort by suit in alphabetical order and then by rank from 2 to A. The pseudocode for bubble sort is as follows: for i=0 up to and including length -2 for j=0 up to and including length i2// each pass make fewer comparisons if A[j]>A[j+1]A[j]<>A[j+1]//swap for i=0 up to and including length - 2 for j=0 up to and including length - i2 //each pass make fewer comparisons if A[j]>A[j+1]A[j]>A[j+1]// swap After you have sorted the deck of cards, write the result to a file named sorted. txt. The CardApp . java file also contains the main() method of the application. Use Develop mode to test your CardApp code along with your Card and LinkedList code. All input and output files must contain a list of cards, with each card stored on its own line. See the example files cards1.txt and cards 2 . txt for example file formats.