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
Computer programming
Svet_ta [14]
Sjanqknjwolq esjkalqlkd
5 0
3 years ago
Secondary sources<br> information gathered from primary sources.
sergeinik [125]

Answer:

what

Explanation:

8 0
4 years ago
Read 2 more answers
Write a program that reads a file name from the keyboard. The file contains integers, each on a separate line. The first line of
Sindrei [870]

Answer:

Explanation:

import java.util.Scanner;

import java.io.*;

public class ArrayProcessing

{

public static void main(String[] args) throws IOException

{

Scanner kb = new Scanner(System.in);

String fileName;

System.out.print("Enter input filename: ");

fileName = kb.nextLine();

File file = new File(fileName);

if(!file.exists())

{

System.out.println("There is no input file called : " + fileName);

return;

}

int[] numbers = inputData(file);

printArray(numbers);

}

public static int[] inputData(File file) throws IOException

{

Scanner inputFile = new Scanner(file);

int index = 1;

int size = inputFile.nextInt();

int[] values = new int[size];

while(inputFile.hasNextInt() && index < values.length)

{

values[index] = inputFile.nextInt();

index++;

}

inputFile.close();

return values;

}

public static void printArray(int[] array)

{

int count = 1;

for (int ndx = 1; ndx < array.length; ndx++)

{

System.out.printf("%5.f\n", array[ndx]);

count++;

}

if(count == 10)

System.out.println("");

}

}

4 0
4 years ago
How to make an upside down exclamation point on mac?
denis-greek [22]
Option + 1

-----------------------------
5 0
3 years ago
Most simple computer programs follow the basic pattern defined by the acronym IPO. What does IPO mean with regards to programmin
Art [367]

Answer:

IPO means Input - Process - Output

Explanation:

The IPO model means that a computer program is given an input to process, it processes the given input and return an output as the result.

3 0
3 years ago
Other questions:
  • Carly is part of a community of developers. In her free time, she works on code to improve this open-source operating system. Th
    11·1 answer
  • Who was eqvtime tayaishvili?​
    13·2 answers
  • Which tabs contains options for adding shapes to a chart ? Check all that apply.
    13·1 answer
  • _______ an embedded Word table to activate the Word features.
    6·1 answer
  • Operating systems provide a measure of security by allowing users to access to those resources they've been cleared to use as we
    8·1 answer
  • Urgent ..algorithm and flowchart to check weather a number is odd or even ???​
    8·2 answers
  • Which disc store compacity for full lenght movie? dvd or cd
    14·1 answer
  • Need help with these
    8·1 answer
  • The response from a Google Form can be seen in how many ways?
    10·1 answer
  • What is a programming language?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!