(Solved) : Gambler Plays Double Dice Throw Gamble Money Casino Gambler Gamble 1 100 Two Dices Tossed Q33141040 . . .



A gambler plays a double dice throw to gamble his money in casino. The gambler can gamble between $1 to $100. Two dices are tossed, and the gambler wins or loses money based on following scenarios I. If the sum of numbers for the two dices is 5 and above but less than 10, the gambler loses 40% of the money that he gambles. If the sum of numbers for the two dices are less than 5, the gambler loses 70% of the money If the sum of numbers for the two dices are 10 or above, the gamble’s investment is doubled 2. 3. Write a java program that: 1. Simulates 10000 dice throw events, and prints it to a file named dice.txt. A dice throw event looks like this 1 2 30 where 1 is the number on first dice, 2 on the second dice, and 30 is the amount gambled on this event. Reads dice.txt and calculates wins or losses for each throw based on the above rules, and prints the throw outcomes along with the win or loss to a file named details.txt. An outcome looks likes this Dicel Dice2 Total Amt. Gam Win Loss 2. 30 40 12 (40%) 12 80 3. After calculating wins, and losses for every individual throw, it calculates the following stats and prints them to a file named stats.txt a. Total winning amount b. Total loss amount c. Average winning amount d. Average loss amount e. Largest winning amount f. Largest loss amoun Construct a method named simulateice that simulates the dices to compute the sum of two dices and prints them to dice.txit Construct a method named writeDetails that reads files.txt and writes the details to details.txt Construct a method named writeStats that reads files.txt and writes the details to stats.txt Show transcribed image text
Expert Answer
Answer to Gambler Plays Double Dice Throw Gamble Money Casino Gambler Gamble 1 100 Two Dices Tossed Q33141040 . . .
OR