Question
The purpose of this exercise is to: (1) Practice writing Boolean Expressions (2) Compare running times of code that uses different Boolean expressions to accomplish
The purpose of this exercise is to: (1) Practice writing Boolean Expressions (2) Compare running times of code that uses different Boolean expressions to accomplish the same task 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 Meaning 0 Tie 1 Player 1 Won 2 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started