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), 23.06.2019 20:20
What is the top speed in a parking lot? a. 10 mph b. 20 mph c. 25 mph d. 30 mph
Answers: 2
question
Advanced Placement (AP), 25.06.2019 13:00
Which allows college students to work part time jobs to pay for educational expenses
Answers: 1
question
Advanced Placement (AP), 25.06.2019 23:20
Which of the following situations would most likely occur if a human-induced event caused the ocean water to become the same temperature around the world? deep ocean current circulation would increase salt distribution around the world's oceans. surface ocean current circulation would distribute heat around land masses at a faster rate. new, fresher water would float on top of dense salt water and limit thermohaline circulation. some land masses in the northern hemisphere would start to warm up over time, melting snow and ice. runoff of surface freshwaters and rainfall would no longer have an effect on the salinity of ocean waters.
Answers: 2
question
Advanced Placement (AP), 26.06.2019 10:30
Which control would most likely achieve the greatest reduction of noise pollution? limiting airplane traffic insulating buildings and homes reducing road and highway traffic using headphones to listen to music building noise barriers beside highways
Answers: 1
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
Questions on the website: 13722361