Advanced Placement (AP)

In a certain game, the integer variable bonus is assigned a value based on the value of the integer variable score. • If score is greater than 100, bonus is assigned a value that is 10 times score.

• If score is between 50 and 100 inclusive, bonus is assigned the value of score.

• If score is less than 50, bonus is assigned a value of 0.

Which of the following code segments assigns bonus correctly for all possible integer values of

score ?

Select two answers.

A

IF(score > 100)

{

bonus score * 10

}

ELSE

{

IF(score ≥ 50)

{

bonus score

}

ELSE

{

bonus 0

}

}

B

IF(score ≥ 50)

{

IF(score > 100)

{

bonus score * 10

}

ELSE

{

bonus 0

}

}

ELSE

{

bonus score

}

answer
Answers: 1

Other questions on the subject: Advanced Placement (AP)

image
Advanced Placement (AP), 23.06.2019 05:30, angellynn581
50 ! if you could have one clothing item of your choice, but it was in either of these colors, which would you choose out of each category? blue or pink red or yellow red or green green or purple blue or green
Answers: 2
image
Advanced Placement (AP), 24.06.2019 12:30, videogamers1214
How can symbols and absolute value you to order sets of integars
Answers: 1
image
Advanced Placement (AP), 25.06.2019 09:10, firdausmohammed80
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
image
Advanced Placement (AP), 25.06.2019 19:30, jamayeah02
In 2009, roughly of people age 12 or older who did not drink alcohol were current users of illegal drugs. a. 4% b. 10% c. 13% d. 20%
Answers: 1
Do you know the correct answer?
In a certain game, the integer variable bonus is assigned a value based on the value of the integer...

Questions in other subjects: