Computers and Technology
Computers and Technology, 19.09.2019 03:20, Doogsterr

Write a program for playing a game with the computer. first, generate a random integer in the range of 6 through 9. this will be the computer’s pick. then generate three random integers for the human player. these random integers are in the range of 1 through 10. if any of these three random integers is greater than the computer’s pick, the human player wins the game. otherwise, the human player loses. you must use a for loop to generate these three random integers. in each iteration, generate and display one random integer. if it is larger than the computer’s pick, display "you have won the game" and break out of the loop. if the human player cannot get a random integer larger than computer’s pick after three iterations , display "sorry you have lost the game".

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, alexdub9649
What is a costume plot? why is it important to a film or theater production?
Answers: 2
image
Computers and Technology, 23.06.2019 12:00, lyn94
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
image
Computers and Technology, 23.06.2019 22:30, kayelynn003
How many points do i need before i can send a chat
Answers: 1
image
Computers and Technology, 24.06.2019 00:40, dheydar3506
What is the error in the following pseudocode? module main() call raisetopower(2, 1.5) end module module raisetopower(real value, integer power) declare real result set result = value^power display result end module
Answers: 1
Do you know the correct answer?
Write a program for playing a game with the computer. first, generate a random integer in the range...

Questions in other subjects:

Konu
Mathematics, 01.02.2021 21:50