1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zepelin [54]
3 years ago
11

What is the output of the following program when the method is called with 4?

Computers and Technology
1 answer:
wolverine [178]3 years ago
8 0

Answer:

C. ?????

Explanation:

Given code:

void unknown(int n)

{

if(n>0)

unkown(n-1);

System.out.print("?");  

}

Calling code: unknown(4)

This is a recursive invocation of unknown function and causes ? to be printed 5 times once each for following values of n.

  • unknown invocation with n=4
  • unknown invocation with n=3
  • unknown invocation with n=2
  • unknown invocation with n=1
  • unknown invocation with n=0

When n becomes 0, termination condition is reached and the function returns.

So the output is ?????

You might be interested in
How many times is the second for loop going to loop in this block of code? Write your answer in numeric form in the box provided
pantera1 [17]

Explanation:

The second for loop does 1 of 4 iterations for every 1 of 5 iterations of the parent loop. meaning it is 4 x 5 which is 20.

8 0
2 years ago
During boom times, which of the
pashok25 [27]
I think the answer is D.
3 0
2 years ago
1st answer will get brainliest!
valentina_108 [34]

The answer is program!

5 0
2 years ago
Read 2 more answers
Modify the provided code file to create a workout tracking program that lets the user enter (from the console) the distance they
koban [17]

Answer:

  1. import java.util.Arrays;
  2. import java.util.Scanner;
  3. public class Main {
  4.    public static void main(String[] args) {
  5.        Scanner input = new Scanner(System.in);
  6.        double distances [] = new double[7];
  7.        for(int i=0; i < distances.length; i++){
  8.            System.out.print("Input running distance for day " + (i+1) + ": ");
  9.            distances[i] = input.nextDouble();
  10.        }
  11.        System.out.println(Arrays.toString(distances));
  12.    }
  13. }

Explanation:

The solution code is written in Java.

Firstly, create a Scanner object to get user input for running distance (Line 6). Next, declare a distances array and set the array size to 7 because we intend to use this array to hold running distance for 7 days per week.

Next, use the for loop that run for 7 times to repeatedly prompt user to input running distance for each day and store each value to the array distances (Line 9 -12).

At last, display the array to console terminal (Line 14).

3 0
3 years ago
Let’s say you attach four images to accompany an important tweet that you’ve composed in the Hootsuite Compose Box. On Twitter,
Damm [24]
I doub between:

<span>  C)  A series of 4 full size, but individual tweets (with the tweet copy appearing above the first image of the series)  D)  A collage format, with full size images</span>

6 0
3 years ago
Other questions:
  • "the file that specifies how netbeans builds and deploys the application when you run the application is called the ____________
    8·1 answer
  • Convert the following decimal number to its equivalent binary ,octal,hexadecimal 1920​
    12·1 answer
  • Amanda, a project manager, conducted a team meeting consisting of testing and development team. She insisted on clear communicat
    11·1 answer
  • What best describes the advantage of using the model of a food web?
    12·2 answers
  • Which of the following statements is false? a. Each object of a class shares one copy of the class's instance variables. b. A cl
    11·1 answer
  • When you connect a device to your computer for the first time, Windows Media Player selects the ____ method that works best for
    15·2 answers
  • NumA = 3 <br>numB = 2<br>Result = numA ** numB
    12·1 answer
  • Brainly is brainly am I correct ​
    11·2 answers
  • What will be displayed after this code segment is run?
    5·1 answer
  • How does accenture generate value for clients through agile and devops?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!