**2.24(游戏:抽牌)编写程序,模拟从一副52张的牌中抽一张牌。程序应该显示牌的大小(Ace、2、3、4、5、6、7、8、9、10、Jack、Queen、King)以及牌的花色(Clubs(黑梅花)、Diamonds(红方块)、Hearts(红心)、Spades(黑桃))。
下面是这个程序的运行示例:
The card you picked is Jack of Hearts
**2.24(Game: pick a card) Write a program that simulates picking a card from a deck of 52 cards. Your program should display the rank (Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King) and suit (Clubs, Diamonds, Hearts, Spades) of the card.
Here is a sample run of the program:
The card you picked is Jack of Hearts
下面是参考答案代码:
public class PickACardQuestion24 {
public static void main(String[] args) {
int rankOfCard,suitOfCard;
rankOfCard = (int)(Math.random()*13) + 1;
suitOfCard = (int)(Math