Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Shavit Borisov
- // CW
- import java.util.Random;
- public class RandomCards {
- public static void main(String[] args)
- {
- Random r = new Random ();
- int num = 1+r.nextInt(13);
- int shape = 1 + r.nextInt(4);
- switch (shape)
- {
- case 1:
- System.out.printf("Your card is %d Heart.", num);
- break;
- case 2:
- System.out.printf("Your card is %d Club.", num);
- break;
- case 3:
- System.out.printf("Your card is %d Diam.", num);
- break;
- case 4:
- System.out.printf("Your card is %d Spade.", num);
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement