subject
Advanced Placement (AP), 27.01.2021 21:40 Gtx014

Now that we know the results, it’s time to determine the winner! Inside your if/else statement that prints out odd or even, add another set of if/else statements to tell who the winner is, based on what the player chose back in stage 1.

Here is some "pseudo code" (notation resembling simplified code, not real code) that you can use to write the real code.

if (the sum was even) {

print out even

if (the user chose evens) {

the user wins

}

else {

the computer wins

}

else {

// inverse of above if statement

}

}

Here is an example of what the output of your stage three should produce:

>Let’s play a game called "Odds or Evens"

>What is your name?

Douglas

>Hi Douglas, which do you choose? (O)dds or (E)vens?

O

>Douglas has picked odds! The computer will be evens.



>How many fingers do you throw?

4

>The computer plays 4 "fingers".



4 + 4 = 8

8 is... even!

That means the computer wins!

ansver
Answers: 1

Another question on Advanced Placement (AP)

question
Advanced Placement (AP), 25.06.2019 09:10
Describe one of your personality traits that you believe to be highly heritable and another trait that seems to be much less so. provide reasons for your answer, and explain why you would expect genetics to exert a greater impact on some personality traits than on others. 10. discuss at least 3 cultural/environmental factors that may influence behavior.
Answers: 3
question
Advanced Placement (AP), 25.06.2019 22:00
When your organs don't receive enough blood, they begin to a. shut down b. speed up c. inflame d. dry out
Answers: 2
question
Advanced Placement (AP), 25.06.2019 22:00
Three of the following infractions will result in your drivers license being suspended. which will cause it to be revoked? a. racing on the highway b. failing to stop for a school bus c. failing to pay child support d. refusing a breath test
Answers: 1
question
Advanced Placement (AP), 26.06.2019 05:40
Ineed an answer for this one (number 8)
Answers: 2
You know the right answer?
Now that we know the results, it’s time to determine the winner! Inside your if/else statement that...
Questions
question
Mathematics, 08.09.2020 23:01
question
Mathematics, 08.09.2020 23:01
question
Social Studies, 08.09.2020 23:01
Questions on the website: 13722361