Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hey! Welcome to Tina's Dice Game Hey! Welcome to Tina's Dice Game Let's start! Let's start! Dice 1 = 4 Dice 1 = 1 Dice

image text in transcribedimage text in transcribed
Hey! Welcome to Tina's Dice Game Hey! Welcome to Tina's Dice Game Let's start! Let's start! Dice 1 = 4 Dice 1 = 1 Dice 2 = 2 Dice 2 = 3 I got 4 and 2! I got 1 and 3! Evens are better than odds! Evens are better than odds! Do you want to play again? Do you want to play again? YES YES Dice 1 = 3 Dice 1 = 5 Dice 2 = 3 Dice 2 = 2 I got 3 and 3! I got 5 and 2! Evens are better than odds! Odds are still cool! The number of times the dice was thrown is: 2 Do you want to play again? Nice game! YES Thanks for playing, Come play again soon! Dice 1 = 3 Dice 2 = 2 I got 3 and 2! Odds are still cool! Hey! Welcome to Tina's Dice Game Let's start! Do you want to play again? YES Dice 1 = 5 Dice 2 = 6 Dice 1 = 4 Dice 2 = 5 I got 5 and 6! Odds are still cool! I got 4 and 5! Odds are still cool! Do you want to play again? Nah Do you want to play again? Uhhhh...I am not really interested anymore The number of times the dice was thrown is: 1 Nice game! The number of times the dice was thrown is: 4 Thanks for playing, Come play again soon! Nice game! Thanks for playing, Come play again soon! HINTS: o A method should only do 1 specific task o Comment on your code (not how, but WHAT) o Use the concepts we learned in classThe Task: I want to play a game: a I have 2 die, 6 sided each a I start the game and print the intro 0 \"Hey! Welcome to Tina's Dice Game.\" 0 \"Let's start!" I The computer randomly generates what side of the die is chosen (for each die) I I then add both of the random numbers together 0 I then print 0 Dice l = (the random number I got) 0 Dice 2 = (the random number I got) 0 Depending on what number I get, something different is printed to the screen 0 If I get an even number I I print \"I got (value of dice l) and (value of dice 2)!\" I I print \"Evens are better than odds!\" o If I get an odd number I I print \"I got (value of dice l) and (value of dice 2)!" I I print \"Odds are still cool!" I At the end, I ask the user if they want to play again 0 If the answer is \"YES\" I I \"throw\" the die again and repeat the printing process 0 If the answer is anything but YES (case-sensitive) I I end the game and print the outro o \"The number of times the dice was thrown is: (value of times dice is thrown)" 0 \"Nice game!" 0 \"Thanks for playing, Come play again soon!\" What You Need to Do: Implement the code so that the output produced follows as below: I have included a few examples: (See next page)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions