Need help converting this to linked list instead of using an array a.docx - Need help converting this to linked list instead of using an array and the

Need help converting this to linked list instead of using an array a.docx

This preview shows page 1 - 6 out of 13 pages.

Image of page 1
Need help converting this to linked list instead of using an array and the driver class public class Card { /********* Instance Data **************/ private String stringFaceValue; //string face of the card private String stringSuitValue; //string suit of the card private int numFaceValue; //integer face of the card //ace is 1 and Jack-King is 11-13 �� private int numSuitValue; //integer suit of the card private int uniqueID; //a unique ID of each card /********** Contructors **************/ public Card(int inSuit, int inFaceVal) { numFaceValue = inFaceVal; numSuitValue = inSuit; stringFaceValue = ""; uniqueID = 0; if(inSuit == 1) stringSuitValue = "Hearts"; else if(inSuit == 2) stringSuitValue = "Clubs";
Image of page 2
else if(inSuit == 3) stringSuitValue = "Diamonds"; else stringSuitValue = "Spades"; } /************ Methods ***************/ public String toString() { //local constants //local variables String format; //formatted string to be returned /********** begin toSTring ***************/ //check which face value to return switch(numFaceValue) { case 1: stringFaceValue = "Ace"; break; case 2: stringFaceValue = "Two"; break; �� case 3:
Image of page 3
Image of page 4
Image of page 5
Image of page 6

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture