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), 27.06.2019 01:30
What happens when two galaxies approach each other? a. they form a black hole. b. they merge because of the strong gravitational pull they exert on each other. c. they shred each other into smaller galaxies. d. they form a supernova. e. they repel each other away because of their strong gravitational pull.
Answers: 1
question
Advanced Placement (AP), 27.06.2019 05:40
Asapembassies differ from consulates in thata) compared to a consulate, an embassy is a smaller representation of a nation's government in a foreign country. b) consulates are permanent diplomatic missions generally located in a country’s capital, whereas a country may have a number of embassies in various cities. c) embassies are permanent diplomatic missions generally located in a country’s capital, whereas a country may have a number of consulates in various cities. d) embassies deal solely with economic diplomacy and trade relations, whereas consulates deal primarily with political and diplomatic relations with the host nation. e) countries establish embassies in another nation only if it recognizes the sovereignty of that country, whereas consulates exist without regard to recognition of a nation's sovereignty.
Answers: 2
question
Advanced Placement (AP), 28.06.2019 14:30
15 i think it's d but i'm not sure
Answers: 1
question
Advanced Placement (AP), 28.06.2019 20:00
Which method is used to extract minerals from stream bends and along coasts?
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, 15.01.2021 21:40
question
Mathematics, 15.01.2021 21:40
question
Mathematics, 15.01.2021 21:40
question
Mathematics, 15.01.2021 21:40
Questions on the website: 13722359