Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Thomas Worrell
- 9/23/2019
- Intro to Java Programming CSC-111
- Homework Three
- Decide who wins in Rock, Paper, Scissors, Lizard, Spock
- taworrell0001@student.stcc.edu
- */
- public class RandomCardProgram
- {
- public static void main(String[] args)
- {
- int cardSuit = (int) (Math.random()*4);
- int cardNum = (int) (Math.random()*13);
- switch(cardSuit)
- {
- case 0:
- switch(cardNum)
- {
- case 0:
- System.out.println("The card you picked is Ace of Diamonds");
- break;
- case 1:
- System.out.println("The card you picked is Two of Diamonds");
- break;
- case 2:
- System.out.println("The card you picked is Three of Diamonds");
- break;
- case 3:
- System.out.println("The card you picked is Four of Diamonds");
- break;
- case 4:
- System.out.println("The card you picked is Five of Diamonds");
- break;
- case 5:
- System.out.println("The card you picked is Six of Diamonds");
- break;
- case 6:
- System.out.println("The card you picked is Seven of Diamonds");
- break;
- case 7:
- System.out.println("The card you picked is Eight of Diamonds");
- break;
- case 8:
- System.out.println("The card you picked is Nine of Diamonds");
- break;
- case 9:
- System.out.println("The card you picked is Ten of Diamonds");
- break;
- case 10:
- System.out.println("The card you picked is Jack of Diamonds");
- break;
- case 11:
- System.out.println("The card you picked is Queen of Diamonds");
- break;
- case 12:
- System.out.println("The card you picked is King of Diamonds");
- break;
- }
- break;
- case 1:
- switch(cardNum)
- {
- case 0:
- System.out.println("The card you picked is Ace of Clubs");
- break;
- case 1:
- System.out.println("The card you picked is Two of Clubs");
- break;
- case 2:
- System.out.println("The card you picked is Three of Clubs");
- break;
- case 3:
- System.out.println("The card you picked is Four of Clubs");
- break;
- case 4:
- System.out.println("The card you picked is Five of Clubs");
- break;
- case 5:
- System.out.println("The card you picked is Six of Clubs");
- break;
- case 6:
- System.out.println("The card you picked is Seven of Clubs");
- break;
- case 7:
- System.out.println("The card you picked is Eight of Clubs");
- break;
- case 8:
- System.out.println("The card you picked is Nine of Clubs");
- break;
- case 9:
- System.out.println("The card you picked is Ten of Clubs");
- break;
- case 10:
- System.out.println("The card you picked is Jack of Clubs");
- break;
- case 11:
- System.out.println("The card you picked is Queen of Clubs");
- break;
- case 12:
- System.out.println("The card you picked is King of Clubs");
- break;
- }
- break;
- case 2:
- switch(cardNum)
- {
- case 0:
- System.out.println("The card you picked is Ace of Hearts");
- break;
- case 1:
- System.out.println("The card you picked is Two of Hearts");
- break;
- case 2:
- System.out.println("The card you picked is Three of Hearts");
- break;
- case 3:
- System.out.println("The card you picked is Four of Hearts");
- break;
- case 4:
- System.out.println("The card you picked is Five of Hearts");
- break;
- case 5:
- System.out.println("The card you picked is Six of Hearts");
- break;
- case 6:
- System.out.println("The card you picked is Seven of Hearts");
- break;
- case 7:
- System.out.println("The card you picked is Eight of Hearts");
- break;
- case 8:
- System.out.println("The card you picked is Nine of Hearts");
- break;
- case 9:
- System.out.println("The card you picked is Ten of Hearts");
- break;
- case 10:
- System.out.println("The card you picked is Jack of Hearts");
- break;
- case 11:
- System.out.println("The card you picked is Queen of Hearts");
- break;
- case 12:
- System.out.println("The card you picked is King of Hearts");
- break;
- }
- break;
- case 3:
- switch(cardNum)
- {
- case 0:
- System.out.println("The card you picked is Ace of Spades");
- break;
- case 1:
- System.out.println("The card you picked is Two of Spades");
- break;
- case 2:
- System.out.println("The card you picked is Three of Spades");
- break;
- case 3:
- System.out.println("The card you picked is Four of Spades");
- break;
- case 4:
- System.out.println("The card you picked is Five of Spades");
- break;
- case 5:
- System.out.println("The card you picked is Six of Spades");
- break;
- case 6:
- System.out.println("The card you picked is Seven of Spades");
- break;
- case 7:
- System.out.println("The card you picked is Eight of Spades");
- break;
- case 8:
- System.out.println("The card you picked is Nine of Spades");
- break;
- case 9:
- System.out.println("The card you picked is Ten of Spades");
- break;
- case 10:
- System.out.println("The card you picked is Jack of Spades");
- break;
- case 11:
- System.out.println("The card you picked is Queen of Spades");
- break;
- case 12:
- System.out.println("The card you picked is King of Spades");
- break;
- }
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement