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), 23.06.2019 12:00
Activity 1.3.2 standard and metric measuring pltw
Answers: 1
question
Advanced Placement (AP), 25.06.2019 00:00
Which of the following statements concerning the effects of happiness is not true? select the best answer from the choices provided feelings of happiness generally lead individuals to demonstrate less care toward others. happy individuals are generally more playful than individuals who are not. research has linked levels of happiness to increases in creative problem solving. happiness, along with love, has been found to provoke prosocial behaviors.
Answers: 1
question
Advanced Placement (AP), 25.06.2019 15:30
Working to improve the working conduit a factory is an example of
Answers: 1
question
Advanced Placement (AP), 26.06.2019 03:00
Mrs. foyle told yolanda that her test had 38 problems worth a total of 100 points. each test problem is worth either 5 points or 2 points. yolanda wanted to determine how many 2-point and how many 5-point questions are on the test. in the space below, determine how many questions of each point-value are on the test. show your work or provide an explanation to support your answer. need this asap
Answers: 1
You know the right answer?
Consider the following recursive method, which is intended to display the binary equivalent of a dec...
Questions
question
Mathematics, 10.06.2021 18:40
question
Mathematics, 10.06.2021 18:40
question
Biology, 10.06.2021 18:40
Questions on the website: 13722359