Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.13 KB | None | 0 0
  1. /*
  2. Thomas Worrell
  3. 9/23/2019
  4. Intro to Java Programming CSC-111
  5. Homework Three
  6. Decide who wins in Rock, Paper, Scissors, Lizard, Spock
  7. taworrell0001@student.stcc.edu
  8. */
  9. public class RandomCardProgram
  10. {
  11. public static void main(String[] args)
  12. {
  13. int cardSuit = (int) (Math.random()*4);
  14. int cardNum = (int) (Math.random()*13);
  15.  
  16. switch(cardSuit)
  17. {
  18. case 0:
  19. switch(cardNum)
  20. {
  21. case 0:
  22. System.out.println("The card you picked is Ace of Diamonds");
  23. break;
  24. case 1:
  25. System.out.println("The card you picked is Two of Diamonds");
  26. break;
  27. case 2:
  28. System.out.println("The card you picked is Three of Diamonds");
  29. break;
  30. case 3:
  31. System.out.println("The card you picked is Four of Diamonds");
  32. break;
  33. case 4:
  34. System.out.println("The card you picked is Five of Diamonds");
  35. break;
  36. case 5:
  37. System.out.println("The card you picked is Six of Diamonds");
  38. break;
  39. case 6:
  40. System.out.println("The card you picked is Seven of Diamonds");
  41. break;
  42. case 7:
  43. System.out.println("The card you picked is Eight of Diamonds");
  44. break;
  45. case 8:
  46. System.out.println("The card you picked is Nine of Diamonds");
  47. break;
  48. case 9:
  49. System.out.println("The card you picked is Ten of Diamonds");
  50. break;
  51. case 10:
  52. System.out.println("The card you picked is Jack of Diamonds");
  53. break;
  54. case 11:
  55. System.out.println("The card you picked is Queen of Diamonds");
  56. break;
  57. case 12:
  58. System.out.println("The card you picked is King of Diamonds");
  59. break;
  60. }
  61. break;
  62. case 1:
  63. switch(cardNum)
  64. {
  65. case 0:
  66. System.out.println("The card you picked is Ace of Clubs");
  67. break;
  68. case 1:
  69. System.out.println("The card you picked is Two of Clubs");
  70. break;
  71. case 2:
  72. System.out.println("The card you picked is Three of Clubs");
  73. break;
  74. case 3:
  75. System.out.println("The card you picked is Four of Clubs");
  76. break;
  77. case 4:
  78. System.out.println("The card you picked is Five of Clubs");
  79. break;
  80. case 5:
  81. System.out.println("The card you picked is Six of Clubs");
  82. break;
  83. case 6:
  84. System.out.println("The card you picked is Seven of Clubs");
  85. break;
  86. case 7:
  87. System.out.println("The card you picked is Eight of Clubs");
  88. break;
  89. case 8:
  90. System.out.println("The card you picked is Nine of Clubs");
  91. break;
  92. case 9:
  93. System.out.println("The card you picked is Ten of Clubs");
  94. break;
  95. case 10:
  96. System.out.println("The card you picked is Jack of Clubs");
  97. break;
  98. case 11:
  99. System.out.println("The card you picked is Queen of Clubs");
  100. break;
  101. case 12:
  102. System.out.println("The card you picked is King of Clubs");
  103. break;
  104. }
  105. break;
  106. case 2:
  107. switch(cardNum)
  108. {
  109. case 0:
  110. System.out.println("The card you picked is Ace of Hearts");
  111. break;
  112. case 1:
  113. System.out.println("The card you picked is Two of Hearts");
  114. break;
  115. case 2:
  116. System.out.println("The card you picked is Three of Hearts");
  117. break;
  118. case 3:
  119. System.out.println("The card you picked is Four of Hearts");
  120. break;
  121. case 4:
  122. System.out.println("The card you picked is Five of Hearts");
  123. break;
  124. case 5:
  125. System.out.println("The card you picked is Six of Hearts");
  126. break;
  127. case 6:
  128. System.out.println("The card you picked is Seven of Hearts");
  129. break;
  130. case 7:
  131. System.out.println("The card you picked is Eight of Hearts");
  132. break;
  133. case 8:
  134. System.out.println("The card you picked is Nine of Hearts");
  135. break;
  136. case 9:
  137. System.out.println("The card you picked is Ten of Hearts");
  138. break;
  139. case 10:
  140. System.out.println("The card you picked is Jack of Hearts");
  141. break;
  142. case 11:
  143. System.out.println("The card you picked is Queen of Hearts");
  144. break;
  145. case 12:
  146. System.out.println("The card you picked is King of Hearts");
  147. break;
  148. }
  149. break;
  150. case 3:
  151. switch(cardNum)
  152. {
  153. case 0:
  154. System.out.println("The card you picked is Ace of Spades");
  155. break;
  156. case 1:
  157. System.out.println("The card you picked is Two of Spades");
  158. break;
  159. case 2:
  160. System.out.println("The card you picked is Three of Spades");
  161. break;
  162. case 3:
  163. System.out.println("The card you picked is Four of Spades");
  164. break;
  165. case 4:
  166. System.out.println("The card you picked is Five of Spades");
  167. break;
  168. case 5:
  169. System.out.println("The card you picked is Six of Spades");
  170. break;
  171. case 6:
  172. System.out.println("The card you picked is Seven of Spades");
  173. break;
  174. case 7:
  175. System.out.println("The card you picked is Eight of Spades");
  176. break;
  177. case 8:
  178. System.out.println("The card you picked is Nine of Spades");
  179. break;
  180. case 9:
  181. System.out.println("The card you picked is Ten of Spades");
  182. break;
  183. case 10:
  184. System.out.println("The card you picked is Jack of Spades");
  185. break;
  186. case 11:
  187. System.out.println("The card you picked is Queen of Spades");
  188. break;
  189. case 12:
  190. System.out.println("The card you picked is King of Spades");
  191. break;
  192. }
  193. break;
  194. }
  195. }
  196. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement