question, loop(s) and conditionals should be used otherwise you will lose marks. Don't hardcode the output otherwise marks will be deducted. The output should be as follow (note: no user input is required): Player 1 rolls a 1 and a 1 Player 1 now has 2 Player 1 rolls a 6 and a 1
The output should be as follow (note: no user input is required): Player 1 rolls a 1 and a 1 Player 1 now has 2 Player 1 rolls a 6 and a 1 Player 1 now has 9 Player 2 rolls a 3 and a 2 Player 2 now has 5 Player 3 rolls a 5 and a 1 Player 3 now has 6 Player 1 rolls a 4 and a 31 Player 1 now has 16 Player 2 rolls a 6 and a 1 Player 2 now has 12 Player 3 rolls a 6 and a 5 Player 3 now has 17 Player 3 wins the first place with a total of 17 Player 1 wins the second place with a total of 16 Player 2 wins the third place with a total of 12
1- Write a program that simulates a game of dice. In this game, 3 players will take alternate turns rolling two dice. On each turn, they record the sum of the two dice and add this to their total. If a player rolls a doublet (both dice have the same value), then the player gets to roll again. After each turn (when both roll), the code checks the sum of each player and the first player to reach a total of 15 or more will win the first place. The code then checks for the second and third place winners. The code will print out to the user the winners in order. For this 1- Write a program that simulates a game of dice. In this game, 3 players will take alternate turns rolling two dice. On
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am