Instructions: Write a program in C++ that uses 2 different functions to compute who would win in a game of Rock Paper Scissors. Each function will use different Boolean Expressions to compute who won. The Boolean Expressions can use arithmetic operators as long as the expressions result in a 1 or a 0. Both functions will take as input, 2 integers as arguments: Player_1- This can be 0, 1, or 2 Player_2- This can be 0, 1, or 2 0=Rock 1=Paper 2=Scissors The functions will return an integer value to indicate a tie or which player won Return Value 0 1 2 Meaning Tie Player 1 Won Player 2 Won Run both functions in separate loops. Output how long it took to run both functions. Note: Both functions need to take in the same exact inputs for every loop iteration.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 9E: (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Question
Instructions: Write a program in C++ that uses 2 different functions to compute who would win in a game of Rock Paper
Scissors. Each function will use different Boolean Expressions to compute who won. The Boolean Expressions can use
arithmetic operators as long as the expressions result in a 1 or a 0.
Both functions will take as input, 2 integers as arguments:
Player_1- This can be 0, 1, or 2
Player_2- This can be 0, 1, or 2
0=Rock
1=Paper
2=Scissors
The functions will return an integer value to indicate a tie or which player won
Return Value
0
1
2
Meaning
Tie
Player 1 Won
Player 2 Won
Run both functions in separate loops. Output how long it took to run both functions.
Note: Both functions need to take in the same exact inputs for every loop iteration.
Transcribed Image Text:Instructions: Write a program in C++ that uses 2 different functions to compute who would win in a game of Rock Paper Scissors. Each function will use different Boolean Expressions to compute who won. The Boolean Expressions can use arithmetic operators as long as the expressions result in a 1 or a 0. Both functions will take as input, 2 integers as arguments: Player_1- This can be 0, 1, or 2 Player_2- This can be 0, 1, or 2 0=Rock 1=Paper 2=Scissors The functions will return an integer value to indicate a tie or which player won Return Value 0 1 2 Meaning Tie Player 1 Won Player 2 Won Run both functions in separate loops. Output how long it took to run both functions. Note: Both functions need to take in the same exact inputs for every loop iteration.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage