subject

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

}

ansver
Answers: 1

Another question on Advanced Placement (AP)

question
Advanced Placement (AP), 24.06.2019 06:30
Is the universal urge to strive for perfection in order to overcome feelings of inferiority. a. pleasure principle b. striving for superiority c. collective unconscious d. reality principle
Answers: 2
question
Advanced Placement (AP), 25.06.2019 09:30
In a speech before the american society of newspaper editors (april 16, 1953), president eisenhower stated: "every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and not clothed. this world in arms is not spending money alone. it is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. this is not a way of life at all in any true sense. under the cloud of threatening war, it is humanity hanging from a cross of iron." do you agree or disagree?
Answers: 1
question
Advanced Placement (AP), 25.06.2019 18:00
Anew moon would be directly overhead at what time
Answers: 2
question
Advanced Placement (AP), 26.06.2019 13:50
The use of fertilizer on a large farm would have the largest effect on which of the following? rate of photosynthesis in local plants amount of smog in the lower atmosphere rate of anaerobic respiration in aquatic bacteria extent of eutrophication in nearby water bodies rate of evapotranspiration from surrounding area
Answers: 1
You know the right answer?
In a certain game, the integer variable bonus is assigned a value based on the value of the integer...
Questions
question
English, 22.06.2021 17:20
question
Spanish, 22.06.2021 17:20
question
Geography, 22.06.2021 17:20