blob: 5655ea2719ab83544b7122be17af7ddc9d43a975 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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);
}
}
|