subject

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".

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:30
What type of file does a cookie place on web site visitors' computers so that web site managers can customize their sites to their visitors' preferences?
Answers: 1
question
Computers and Technology, 22.06.2019 18:40
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
Answers: 2
question
Computers and Technology, 24.06.2019 01:30
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
question
Computers and Technology, 24.06.2019 02:20
The first time a user launches the powerpoint program, which view is shown allowing the user to access recent presentations or create new presentations based on templates?
Answers: 1
You know the right answer?
Write a program for playing a game with the computer. first, generate a random integer in the range...
Questions
question
Mathematics, 22.01.2021 01:20
question
Mathematics, 22.01.2021 01:20
question
Mathematics, 22.01.2021 01:20
question
Mathematics, 22.01.2021 01:20
question
English, 22.01.2021 01:20
question
History, 22.01.2021 01:20
Questions on the website: 13722367