You may work with one partner on this in lab.
Create a BlueJ project named inlab4 and copy the following files into it:
Draw an UML diagram of the following three classes: Card, BlackJackCard and Hand. Use MS-Word or some other program of your choice.
Define an InvalidSuitException. This exception should be thrown in the verifySuit method of the Card class if the suit of the card is not one of clubs, diamonds, hearts or spades. Modify the readSuit method so that it takes advantage of this exception and continues to ask the user for a card suit until a legal one is entered.
This task is very similar to the above one. Define an InvalidRankException. This exception should be thrown in the verifyRank method of the Card class if the rank of the card is not one of: two, three, four, five, six, seven, eight, nine, ten, jack, queen, king or ace. Modify the readRank method so that it takes advantage of this exception and continues to ask the user for a card rank until a legal one is entered.
Define an InvalidHandException. This exception should be thrown in the verifyHand method of the Hand class if the two cards in the hand are identical. (This would indicate that cheating has occurred!) Modify the main method in the Driver to take advantage of this new exception. The main method should only score the hand, if there is not an InvalidHandException. Otherwise an appropriate error message should be printed. Add a comment to the verifyHand method that uses the Javadoc tag @throws properly.
E-mail your code and your UML diagram to your lab TA in one message. The subject of the message should be: CS221-xx inlab4 your-names. The xx is the number of your lab section.
Delete the inlab4 project that you created and the UML diagram. Empty the recycle bin. Thank you.