Problem Description In this problem, you will write a program that reads data pertaining to the number of rolls played b

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Problem Description In this problem, you will write a program that reads data pertaining to the number of rolls played b

Post by answerhappygod »

Problem Description In This Problem You Will Write A Program That Reads Data Pertaining To The Number Of Rolls Played B 1
Problem Description In This Problem You Will Write A Program That Reads Data Pertaining To The Number Of Rolls Played B 1 (81.03 KiB) Viewed 8 times
Problem Description In this problem, you will write a program that reads data pertaining to the number of rolls played by each user and the total score obtained. Furthermore, each game has a certain number of rounds and then turns played that is not known beforehand. The program should determine the count of games that was won by each player, while excluding from the count the games that were drawn because the score obtained was equal. Also, the number of turns and highest score obtained on any given turn by each player should be returned as output to the console. Input You will receive [from the user] the following as input (in order]: • The rounds played per game, labelled as Round1, Round2, and so on. Note that once players have finished the game, this is denoted by "-1". • The number of times the dice will be rolled (e.g., 2 for rolling the dice 2 times) • The dice number obtained for each roll. [e.g., for 2 rolls, write two numbers between 1-6]. Players will roll the dice one after another. In other words, first the roll obtained by player 1 is given [i.e., 3), then the following integer is the score obtained by player 2 (e.g., 5), and so on until all the rolls happen. • Each turn made by a player is associated with a score, the sum of which is displayed as the total score obtained for that game Processing 1. Display the round 2. List the player scores for each round 3. Listo which player won each round 4. List the number of games won by a given player or drawn 5. List the rounds completed by each player for the game listed above 6. Display the final count for the total amount of games won by each player [i.e., excluding the games that were drawn) 7. Display the highest score by both players at any given turn
Examples Input 2 19 Round! 45 19 6 2 Round 4 5 101 10 3 6 Round2 5 6 37 3 Round 1 1 11 1 Output Round! Player 1 total: 7 Player 2 total: 11 Player 2 Wins Game Total games won by each player: Player 1: 0 Player 2:1 Number of player turns: 1 Highest score Player 1: 7 Highest score Player 21 Round Player 1 total: 7 Player 2 total: 11 Player 2 Wins Game Round2 Player 1 total: 11 Player 2 total 7 Player 1 Wins Game Total games won by each player: Player 1:1 Player 2:1 Number of player turns: 2 Highest score Player 1:11 Highest score Player 2: 11 Round Player 1 total: 3 Player 2 total: 3 Game is a draw Total games won by each player: Player 1:0 Player 2:0 Number of player turns: 1 Highest score Player 1: 3 Highest score Player 2: 3
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply