subject
World Languages, 22.02.2021 22:00 gonzaloc

Write a program that plays a simple dice game between the computer and the user. When the program runs, a loop should repeat 5 times. Each iteration of the loop should do the following:
 Generate a random integer in the range of 1 through 6. This is the value of the computer’s die.
 Ask from user an integer in the range of 1 through 6. This is the value of the user’s die.
 The die with the highest value wins. (In case of a tie, there is no winner for that particular roll of the
dice.)
You need to validate the input if it’s correct or not. As the loop iterates, the program should keep count of the
number of times the computer wins, and the number of times that the user wins. After the loop performs all of
its iterations, the program should display who was the grand winner, the computer or the user.

ansver
Answers: 1

Another question on World Languages

question
World Languages, 23.06.2019 03:00
こんにちは, 皆様、このサイトであまり日本語のpostを見つからなくて、もし質問があったら、ぜひcommentに聞いてください。 hello, i couldn't really find any posts on this site about japanese. but if you have any questions about japanese, feel free to ask me down below in the comments/replies. have fun learning !
Answers: 1
question
World Languages, 25.06.2019 01:00
Jeremy planned to read the following poem aloud: wisdom by sara teas daleit was a night of early spring, the winter-sleep was scarcely broken; around us shadows and the wind listened for what was never spoken.though half a score of years are gone, spring comes as sharply now as then— but if we had it all to doit would be done the same again. it was a spring that never came; but we have lived enough to know that what we never have, remains; it is the things we have that go. jeremy interpreted this poem to mean that certain people, places, 'and things are important to us in our lives. but as time passes, we lose those things. what technique could jeremy use when reading the poem to emphasize this idea for listeners? a.he could read the poem rapidly to show how quickly people lose what’s important to them. b.he could emphasize the rhyming pattern in each stanza to represent patterns in life. c.he could read the poem slowly to represent the changes that happen over a lifetime. d.he could raise and lower his voice to represent the good and bad things people face in life.
Answers: 1
question
World Languages, 26.06.2019 16:00
Difference between the angle of inciden
Answers: 1
question
World Languages, 26.06.2019 21:50
Asevere storm that must commonly occurs in tropical regions is a(n)
Answers: 1
You know the right answer?
Write a program that plays a simple dice game between the computer and the user. When the program ru...
Questions
question
Mathematics, 29.01.2021 17:50
question
Mathematics, 29.01.2021 17:50
question
Mathematics, 29.01.2021 17:50
question
Mathematics, 29.01.2021 17:50
question
Chemistry, 29.01.2021 17:50
Questions on the website: 13722359