Firstly, I would like to point out that this assignment is already past due so even if you were to program it for me, it would do me no good other than me learning it. I have been trying to figure out how to program this but I have had no luck. I simply want someone to guide me on how to do this and not so much tell me how to do it but help me so I can figure it out. Any advice would be helpful.
Here is what I was given
CSCI 3326, Lab3: Create a deck of playing cards
Topics: Objects, private versus public attributes and methods, ArrayList/LinkedList containers, object composition
Create a ‘Card’ class (in a file named Card.java) to get part 1 of the Driver.java test program working. Next, create a ‘DeckOfCards’ class (in a file named DeckOfCards.java) and get the remaining steps of the program working. The Driver.java provides test code along with the proper output of the test run.
import java.util.*; public class Driver { public static void main(String [] args) { //Step 1: Test Card class Card joker, fiveHeart, eightClub, aceDiamond, kingSpade; joker = new Card(); fiveHeart = new Card(5,"heart"); eightClub = new Card(8, "club"); aceDiamond = new Card(1, "diamond"); kingSpade = new Card(13, "spade"); System.out.println("Here are the cards: " + joker + ", " + fiveHeart + ", " + eightClub + ", " + aceDiamond + ", " + kingSpade); System.out.println("Testing 'getNum' method: " + eightClub.getNumber()); System.out.println("Testing 'getSuit' method: " + aceDiamond.getSuit()); //Step 2: test the deck: make a constructor to create the //standard deck of 52 cards DeckOfCards deck; deck = new DeckOfCards(); System.out.println(deck); //Step 3: shuffle deck and deal a hand.. //Note: dealing a card should remove and return the top card from the deck. deck.shuffle(); for(int i=0; i<5; i++) System.out.println( deck.dealTopCard() ); System.out.println(""); //Step 4: try a special deck: ArrayList<String> monsters = new ArrayList<String>(); monsters.add("orc"); monsters.add("goblin"); monsters.add("owlbear"); monsters.add("snake"); monsters.add("shinyskinvampire"); DeckOfCards fantasyDeck = new DeckOfCards(10, 12, monsters); fantasyDeck.shuffle(); System.out.println(fantasyDeck); //Below is a sample output for the above test program. /* Here are the cards: 0 of jokers, 5 of hearts, 8 of clubs, ace of diamonds, king of spades Testing 'getNum' method: 8 Testing 'getSuit' method: diamond ace of hearts ace of spades ace of diamonds ace of clubs 2 of hearts 2 of spades 2 of diamonds 2 of clubs 3 of hearts 3 of spades 3 of diamonds 3 of clubs 4 of hearts 4 of spades 4 of diamonds 4 of clubs 5 of hearts 5 of spades 5 of diamonds 5 of clubs 6 of hearts 6 of spades 6 of diamonds 6 of clubs 7 of hearts 7 of spades 7 of diamonds 7 of clubs 8 of hearts 8 of spades 8 of diamonds 8 of clubs 9 of hearts 9 of spades 9 of diamonds 9 of clubs 10 of hearts 10 of spades 10 of diamonds 10 of clubs jack of hearts jack of spades jack of diamonds jack of clubs queen of hearts queen of spades queen of diamonds queen of clubs king of hearts king of spades king of diamonds king of clubs 2 of clubs 7 of hearts 8 of diamonds ace of hearts 5 of spades jack of snakes queen of orcs 10 of shinyskinvampires queen of goblins queen of snakes 10 of orcs queen of owlbears 10 of goblins 10 of snakes jack of shinyskinvampires jack of goblins jack of orcs jack of owlbears queen of shinyskinvampires 10 of owlbears */ } }