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

Other questions on the subject: World Languages

image
World Languages, 24.06.2019 13:40, karmaxnagisa20
Describe a trait that would black moth survive in sooty environment explain
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 19:00, gudon986732
Enade, 2005 – adaptada) "a respeito dos estudos comparativos, a resposta de weber foi a elaboraç? o de "tipos ideais", que constituem um dispositivo generalizante, um modelo heurístico, sobre o qual era possível aplicar a comparaç? o. nas suas explicaç? es históricas comparadas, weber rejeita sempre a hipótese de leis ou de monocausalidade; ele pensa, portanto, que um evento pode ter diversas causas e que conjuntos diversos de causas podem ter o mesmo efeito. a validade das comparaç? es em weber provém das suas construç? es empíricas dos processos de induç? o e de introspecç? o mais do que de uma verificaç? o causal de hipóteses. paola rebughini. a comparaç? o qualitativa de objetos complexos e o efeito da reflexividade. in: alberto melluci (org.) por uma sociologia reflexiva: pesquisa qualitativa e cultura. petrópolis: vozes, 2005, p. 242 (com adaptaç? es)." a partir do fragmento de texto, avalie as seguintes afirmaç? es:
Answers: 1
image
World Languages, 27.06.2019 09:00, sarahlearn3
Which is the correct definition of an economy ?
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 in other subjects:

Konu
Mathematics, 22.10.2021 20:00