subject
Advanced Placement (AP), 09.04.2021 20:40 nick607

Consider the following recursive method, which is intended to display the binary equivalent of a decimal number. For example, toBinary(100) should display 1100100. public static void toBinary(int num)
{
if (num < 2)
{
System. out. print(num);
}
else
{
/* missing code */
}
}
Which of the following can replace /* missing code */ so that toBinary works as intended?

System. out. print(num % 2);
toBinary(num / 2);
A

System. out. print(num / 2);
toBinary(num % 2);
B

toBinary(num % 2);
System. out. print(num / 2);
C

toBinary(num / 2);
System. out. print(num % 2);
D

toBinary(num / 2);
System. out. print(num / 2);
E

ansver
Answers: 1

Another question on Advanced Placement (AP)

question
Advanced Placement (AP), 24.06.2019 19:00
Melissa is fearful of men and refuses to go on dates. her therapist suggests that she is fearful because she was sexually abused when she was young. the therapist's suggestion most clearly reflects a perspective. a.) humanistic b.) behavioral c.) biological d.) psychoanalytic e.) sociocultural
Answers: 1
question
Advanced Placement (AP), 26.06.2019 18:00
Let r(t) represent the rate, in square feet per minute, at which a groundskeeper is mowing a lawn t minutes after 3 p.m. what expression represents the area, in square feet, of the lawn that is mowed between 3 p.m. and 5 p.m.?
Answers: 1
question
Advanced Placement (AP), 27.06.2019 01:30
Is made of materials that are poor conductors, such as glass, plastic, or rubber. they are used in an attempt to keep an electrical current within safe boundaries. for example, the plastic coating on an electrical wire is and is designed to keep the electricity in the wire
Answers: 1
question
Advanced Placement (AP), 27.06.2019 02:50
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
You know the right answer?
Consider the following recursive method, which is intended to display the binary equivalent of a dec...
Questions
question
History, 21.04.2021 23:10
question
English, 21.04.2021 23:10
question
Mathematics, 21.04.2021 23:10
question
Mathematics, 21.04.2021 23:10
question
Business, 21.04.2021 23:10
Questions on the website: 13722361