Computers and Technology
Computers and Technology, 29.10.2021 04:00, lcdavis16

Add the following features to your RPS program: Handle scenario if enters an integer other than 1, 2, or 3. Print "invalid" message and loop again.
Handle the exeption if user enters "abc" or a float. Print "invalid" message and loop again
Keep a counter of how many times the human has won, and how many times comp has won.
After each round, print the outcome and print the counters.
Keep playing until the human or the computer wins twice.
Change your logic to determine the outcome:
Add a 2D list at the top of your code that stores all outcome combinations
Replace your if statement – lookup the outcome from the 2D list
Print a "goodbye" message at the end of the program.
Requirements – Planned Output:
Enter 1 for Rock, 2 for Paper, 3 for Scissors: abc
Please only enter an integer. Try again.
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 60
Invalid int. Please enter 1, 2, or 3. Try again.
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 2
You chose paper
The computer chose scissors
You lost.
Human: 0 Computer: 1
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 3
You chose scissors
The computer chose paper
Congrats, you won!
Human: 1 Computer: 1
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 1
You chose rock
The computer chose scissors
Congrats, you won!
Human: 2 Computer: 1

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, 1232444553
Which of the following examples has four beats in each measure?
Answers: 2
image
Computers and Technology, 22.06.2019 17:00, Dweath50
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server. so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
image
Computers and Technology, 23.06.2019 09:10, djs1671
(328 inc. 448 ind. 480 in25. john has a collection of toy cars. he has 2 red cars, 4 blue cars, 4 black cars, and 6 yellowcars. what is the ratio of red cars to yellow cars? a. 1: 2b. 1: 3c. 1: 626. the net of a right triangular prism is shown below.
Answers: 2
image
Computers and Technology, 24.06.2019 08:20, brinks7994
Which type of entity describes a fundamental business aspect of a database? a. linking b. lookup c. domain d. weak
Answers: 3
Do you know the correct answer?
Add the following features to your RPS program: Handle scenario if enters an integer other than 1,...

Questions in other subjects:

Konu
Mathematics, 05.10.2020 15:01
Konu
Mathematics, 05.10.2020 15:01
Konu
Mathematics, 05.10.2020 15:01