Question: Using Jgrap Java EGR 140: Computer Programming Assignment # 10 Assigned: Wednesday, 4 October 2017 Due: Friday, 13 October 2017 Points: 20 For the purposes
EGR 140: Computer Programming Assignment # 10 Assigned: Wednesday, 4 October 2017 Due: Friday, 13 October 2017 Points: 20 For the purposes of an online poker game, we need to generate poker hands using random numbers from our computer. First we want to test our random number generator to see if it is "fair". To test the fairness, we need a program that generates a simple histogram based on the cards in a deck of 52 playing cards Write an error-free Java program to do the following things. Generte 6*52 = 312 random numbers that are integers from 1 to 13. (Use a loop to generate the numbers.) The program only needs to generate one random number at a time. The number represents a simulated card. The 312 is to simulate 6 decks of playing cards. We will ignore suits. Use an array to count how many times each card type occurs. No need to track jacks, queens, kings or aces. It is easiest to just assign a number to each card type Display how many times each card occurred. That is, display how many times a 2 happened, a 3 happened, etc Determine which card occurred most often. One can ignore ties; that is, if two or more numbers occur the same amount, just specify one of the numbers. If the random number generator is fair, then each card should be about the same Sample output *Number of 1 cards dealt = 26 . Number of 2 cards dealt 17 .Number of 3 ca rds dealt 18 . Number of 4 cards dealt = 18 .1 Number of 5 cards dealt = 25
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
