CSCI 1301 Lab 7
Playing Cards v1
For Lab 7, you'll use the ability to recognize playing cards as we did in
class (Exercise P5.2 on p. 222) and extend it to a basis for a game (blackjack
or poker).
- Instead of an application, make the program an applet (extend applet and
use the init() method or constructor instead of main() method)
- Create a colorful Web page that has the applet centered on the screen in a
small box (100x100) - the popup windows will run in front
- Instead of a single card, take two cards from user input.
- State the names of the two cards.
- Test to see whether the two cards are a "pair" (have the same face).
- Test to see whether the two cards constitute a "blackjack" (sum = 21: i.e.
AS, 10D or QH, AC, for example)
- Show a popup (message dialog) declaring the pair or blackjack
- OPTIONAL: Give the Blackjack value of the hand (2D, JH would be 12 total,
etc.) if it's not a blackjack (5 pts. extra credit)
At the top of the file, place the following lines of comments:
// FileName.java
// by Your Name
// CS1301
// Lab #
// Date
Due Thursday, November 10, ONLINE at the beginning of class. Make sure to save in a
folder (if using a USB drive) called cs1301/lab7/, as well as in a folder on
your P: drive called P:\web\cs1301\lab7. Link to the applet HTM file from your
CS 1301 home page.