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

Other questions on the subject: Advanced Placement (AP)

image
Advanced Placement (AP), 25.06.2019 06:00, carlomorales200
Why is it essential to operationally define the variables in a study?
Answers: 1
image
Advanced Placement (AP), 25.06.2019 15:30, tnassan5715
Which of the following types of stars had the smallest initial mass? which of the following types of stars had the smallest initial mass?
Answers: 1
image
Advanced Placement (AP), 27.06.2019 02:50, haileybug0305
There was an overuse of fertilizers in william's farm. this led to the destruction of the crops, and william incurred huge losses. which management function was neglected in this process?
Answers: 2
image
Advanced Placement (AP), 27.06.2019 07:40, annethelusma25
The patient was the driver in a motor vehicle collision, a one-vehicle rollover occurred that was caused due to lack of control. the patient is now bleeding into the abdominal cavity. the physician brings this patient to the operating room to remove the spleen in order to control this patient's bleeding. the major vessels of the lacerated spleen were carefully dissected, and the spleen was removed in its entirety? cpt code: icd10-cm code: icd10-cm code
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 in other subjects:

Konu
Mathematics, 20.10.2020 18:01
Konu
Mathematics, 20.10.2020 18:01
Konu
English, 20.10.2020 18:01