World Languages
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.

answer
Answers: 1

Other questions on the subject: World Languages

image
World Languages, 23.06.2019 22:50, valeriestamann
What two unlike elements are being compared in this simile? the cyclops and the mast of a ship the cyclops' belly and his sheep manflesh and gulps of whey a mast and a flock of sheep
Answers: 1
image
World Languages, 26.06.2019 15:00, Redhead667
Many colonist in america joined army and fought to be free from british rule
Answers: 1
image
World Languages, 26.06.2019 15:30, Yskdl
John enjoys watching crime shows and his best subject in school was chemistry. what might be a go. od career for him to explore?
Answers: 2
image
World Languages, 27.06.2019 12:30, angel182
Gdzie chce mieszkać argumenty plis ratuje pasek : (
Answers: 2
Do you know the correct answer?
Write a program that plays a simple dice game between the computer and the user. When the program ru...

Questions in other subjects:

Konu
Biology, 24.03.2020 21:31
Konu
Social Studies, 24.03.2020 21:31
Konu
Mathematics, 24.03.2020 21:31
Konu
Biology, 24.03.2020 21:31
Konu
Chemistry, 24.03.2020 21:31
Konu
History, 24.03.2020 21:31