summaryrefslogtreecommitdiffstats
path: root/Java/BlackJack/CardTester.java
diff options
context:
space:
mode:
Diffstat (limited to 'Java/BlackJack/CardTester.java')
-rw-r--r--Java/BlackJack/CardTester.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/Java/BlackJack/CardTester.java b/Java/BlackJack/CardTester.java
new file mode 100644
index 0000000..5655ea2
--- /dev/null
+++ b/Java/BlackJack/CardTester.java
@@ -0,0 +1,30 @@
+/* CardTester.java
+Name: Nancy Reddig, Academy Instructor
+Date: 5/15/03
+Modified by:
+Carl Frank, 08/29/07
+Modifications were to not allow access to instance variables of Card.
+The assumptions are that these will be private.
+Use this class to test your Card Class
+Program that tests the Card Class*/
+// Java packages
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*; // program uses JOptionPane
+public class CardTester {
+// main method begins execution of Java application
+public static void main( String args[] ) {
+
+Card card1= new Card("King", "Hearts");
+// allow the user to think that they are dealing a random card
+
+JOptionPane.showMessageDialog(null, "Deal a Card",
+"Card", JOptionPane.INFORMATION_MESSAGE );
+//display the card
+JOptionPane.showMessageDialog( null, "The card is the " + card1.getFaceValue() + " of " //copying code from a pdf and having to debug it? Now this is a new low
+ + card1.getSuit(),
+ "Your Card", JOptionPane.PLAIN_MESSAGE );
+
+System.exit(0);
+}
+}