diff --git a/.classpath b/.classpath
deleted file mode 100644
index fceb480..0000000
--- a/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/.gitignore b/.gitignore
index 8c9a6ec..702c1c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -76,4 +76,6 @@ $RECYCLE.BIN/
*.msp
# Windows shortcuts
-*.lnk
\ No newline at end of file
+*.lnk
+
+.project
diff --git a/.project b/.project
deleted file mode 100644
index 0365963..0000000
--- a/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- Elevens
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
-
-
diff --git a/README.md b/README.md
index c852477..26ef96b 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,7 @@ $ git remote add upstream https://github.com/mvhs-apcs/Elevens.git
Then create a branch that tracks with the original repo's activity 1 branch:
```
+$ git fetch upstream a1
$ git checkout -b a1 upstream/a1
```
@@ -31,9 +32,21 @@ $ git push origin a#
## Switching to the next activity
-The activities have not all been pushed at the start of the lab because each activity builds on the next and sometimes has working versions of the problems from the previous activities.
+### Activities 1-5
-To move to the next activity, show your completed solution to your instructor. He will then push a branch for you to use for the next activity. The branch name will be formatted like this: `-a#`. For example, Abe Lincoln would move to activity 4 with this command:
+Change the # to the number of the activity you want to grab.
+
+```
+$ git fetch upstream a#
+$ git checkout -b a# upstream/a#
+```
+
+### Later Activities
+
+The remaining activities have not all been pushed because each activity builds on the next. Sometimes activities have working versions of the problems from the previous activities.
+
+To move to the next activity, show your completed solution to your instructor. He will then push a branch for you to use for the next activity. The branch name will be formatted like this: `-a#`. For example, Abe Lincoln would move to activity 6 with this command:
```
-$ git checkout -b a4 upstream/four_score-a4
+$ git fetch upstream four_score-a6
+$ git checkout -b a6 upstream/four_score-a6
```
\ No newline at end of file
diff --git a/answers.md b/answers.md
new file mode 100644
index 0000000..56cccc4
--- /dev/null
+++ b/answers.md
@@ -0,0 +1,24 @@
+1. Explain in your own words the relationship between a deck and a card.
+Cards make up the components of the deck. The deck is an arraylist of cards. In a single deck, there will be 52 cards. A card can be by itself, but for a deck to exist, there must be multiple cards.
+
+2. Consider the deck initialized with the statements below. How many cards does the deck contain?
+ String[] ranks = {"jack", "queen", "king"};
+ String[] suits = {"blue", "red"};
+ int[] pointValues = {11, 12, 13};
+ Deck d = new Deck(ranks, suits, pointValues);
+
+From the looks of it, the programmer was planning to create three separate cards. However, the fact there are only two suits, instead of three to correlate with the number of ranks and point values, would cause an index out of bounds error. Right now, there would be no cards in the deck because the code would not be able to compile. In order for the code to run, the programmer would need to add another cell to the suit array for the command line to say there are three separate cards.
+
+3. The game of Twenty-One is played with a deck of 52 cards. Ranks run from ac (highest) down to 2 (lowest). Suits are spades, hearts, diamonds, and clubs as in many other games. A face card has point value 10; an ace has point value 11; point values for 2, …, 10 are 2, …, 10, respectively. Specify the
+contents of the ranks, suits, and pointValues arrays so that the statement:
+ Deck d = new Deck(ranks, suits, pointValues);
+initializes a deck for a Twenty-One game.
+
+String[] ranks = {“2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “10”, “Jack”, “Queen”, “King”, “Ace”};
+String[] suits = {“Spades”, “Diamonds”, “Clubs”, “Hearts”};
+int [] pointValues = {2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 11};
+
+4. Does the order of elements of the ranks, suits, and pointValues arrays matter?
+Yes! The order of elements of the ranks, suits, and pointValues arrays do matter! The cells correlate with each other. All the information in cell 0 for ranks, suits, and pointValues would make one specific card. The programmer needs to make a pattern with the arrays to create the cards that he or she wants.
+
+It might not matter as much when the user is first initializing the information. However, the cells for sure need to correlate when we are testing our code.
\ No newline at end of file
diff --git a/src/Card.java b/src/Card.java
new file mode 100644
index 0000000..67ef394
--- /dev/null
+++ b/src/Card.java
@@ -0,0 +1,92 @@
+/**
+ * Card.java
+ *
+ * Card represents a playing card.
+ */
+public class Card {
+
+ /**
+ * String value that holds the suit of the card
+ */
+ private String suit;
+
+ /**
+ * String value that holds the rank of the card
+ */
+ private String rank;
+
+ /**
+ * int value that holds the point value.
+ */
+ private int pointValue;
+
+
+ /**
+ * Creates a new Card instance.
+ *
+ * @param cardRank a String value
+ * containing the rank of the card
+ * @param cardSuit a String value
+ * containing the suit of the card
+ * @param cardPointValue an int value
+ * containing the point value of the card
+ */
+ public Card(String cardRank, String cardSuit, int cardPointValue) {
+ //initializes a new Card with the given rank, suit, and point value
+ rank = cardRank;
+ suit = cardSuit;
+ pointValue = cardPointValue;
+ }
+
+
+ /**
+ * Accesses this Card's suit.
+ * @return this Card's suit.
+ */
+ public String suit() {
+ return suit;
+ }
+
+ /**
+ * Accesses this Card's rank.
+ * @return this Card's rank.
+ */
+ public String rank() {
+ return rank;
+ }
+
+ /**
+ * Accesses this Card's point value.
+ * @return this Card's point value.
+ */
+ public int pointValue() {
+ return pointValue;
+ }
+
+ /** Compare this card with the argument.
+ * @param otherCard the other card to compare to this
+ * @return true if the rank, suit, and point value of this card
+ * are equal to those of the argument;
+ * false otherwise.
+ */
+ public boolean matches(Card otherCard) {
+ return otherCard.suit().equals(this.suit())
+ && otherCard.rank().equals(this.rank())
+ && otherCard.pointValue() == this.pointValue();
+ }
+
+ /**
+ * Converts the rank, suit, and point value into a string in the format
+ * "[Rank] of [Suit] (point value = [PointValue])".
+ * This provides a useful way of printing the contents
+ * of a Deck in an easily readable format or performing
+ * other similar functions.
+ *
+ * @return a String containing the rank, suit,
+ * and point value of the card.
+ */
+ @Override
+ public String toString() {
+ return rank + " of " + suit + " (point value = " + pointValue + ")";
+ }
+}
diff --git a/src/Deck.java b/src/Deck.java
new file mode 100644
index 0000000..6f4c563
--- /dev/null
+++ b/src/Deck.java
@@ -0,0 +1,130 @@
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * The Deck class represents a shuffled deck of cards.
+ * It provides several operations including
+ * initialize, shuffle, deal, and check if empty.
+ */
+public class Deck {
+
+ /**
+ * cards contains all the cards in the deck.
+ */
+ private List cards;
+
+ /**
+ * size is the number of not-yet-dealt cards.
+ * Cards are dealt from the top (highest index) down.
+ * The next card to be dealt is at size - 1.
+ */
+ private int size;
+
+
+ /**
+ * Creates a new Deck instance.
+ * It pairs each element of ranks with each element of suits,
+ * and produces one of the corresponding card.
+ * @param ranks is an array containing all of the card ranks.
+ * @param suits is an array containing all of the card suits.
+ * @param values is an array containing all of the card point values.
+ */
+ public Deck(String[] ranks, String[] suits, int[] values) {
+ /* *** TO BE IMPLEMENTED IN ACTIVITY 2 *** */
+ this.cards= new ArrayList();
+ for(int i=0;i= 0; k--) {
+ rtn = rtn + cards.get(k);
+ if (k != 0) {
+ rtn = rtn + ", ";
+ }
+ if ((size - k) % 2 == 0) {
+ // Insert carriage returns so entire deck is visible on console.
+ rtn = rtn + "\n";
+ }
+ }
+
+ rtn = rtn + "\nDealt cards: \n";
+ for (int k = cards.size() - 1; k >= size; k--) {
+ rtn = rtn + cards.get(k);
+ if (k != size) {
+ rtn = rtn + ", ";
+ }
+ if ((k - cards.size()) % 2 == 0) {
+ // Insert carriage returns so entire deck is visible on console.
+ rtn = rtn + "\n";
+ }
+ }
+
+ rtn = rtn + "\n";
+ return rtn;
+ }
+}
diff --git a/src/DeckTester.java b/src/DeckTester.java
new file mode 100644
index 0000000..0c55be9
--- /dev/null
+++ b/src/DeckTester.java
@@ -0,0 +1,37 @@
+/**
+ * This is a class that tests the Deck class.
+ */
+public class DeckTester {
+
+ /**
+ * The main method in this class checks the Deck operations for consistency.
+ * @param args is not used.
+ */
+ public static void main(String[] args) {
+ /* *** TO BE IMPLEMENTED IN ACTIVITY 2 *** */
+ String[] rank1 = {"Queen", "Ace", "2"};
+ String[] suit1 = {"Clubs", "Hearts", "Spades"};
+ int[] value1 = {12, 1, 2};
+ Deck deck1 = new Deck(rank1, suit1, value1);
+ System.out.println("Deck1 size should be 3: " + deck1.size());
+ System.out.println("Deck1 should not be empty: " + !deck1.isEmpty());
+ System.out.println("Deck1 dealt card is: " + deck1.deal());
+
+ String[] rank2 = {"5", "6", "7"};
+ String[] suit2 = {"Clubs", "Spades", "Diamonds"};
+ int[] value2 = {5, 6, 7};
+ Deck deck2 = new Deck(rank2, suit2, value2);
+ System.out.println("Deck2 size should be 3: " + deck2.size());
+ System.out.println("Deck2 should not be empty: " + !deck2.isEmpty());
+ System.out.println("Deck2 dealt card is: " + deck2.deal());
+
+ String[] rank3 = {"1", "Jack", "Queen"};
+ String[] suit3 = {"Diamonds", "Spades", "Clubs"};
+ int[] value3 = {1, 11, 12};
+ Deck deck3 = new Deck(rank3, suit3, value3);
+ System.out.println("Deck3 size should be 3: " + deck3.size());
+ System.out.println("Deck3 should not be empty: " + !deck3.isEmpty());
+ System.out.println("Deck3 dealt card is: " + deck3.deal());
+
+ }
+}