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
goldenfox [79]
3 years ago
11

Write a method called makeLine. The method receives an int parameter that is guaranteed not to be negative and a character. The

method returns a String whose length equals the parameter and contains no characters other than the character passed. Thus, if the makeLine(5,':') will return ::::: (5 colons). The method must not use a loop of any kind (for, while, do-while) nor use any String methods other than concatenation. Instead, it gets the job done by examining its parameter, and if zero returns an empty string otherwise returns the concatenation of the specified character with the string returned by an appropriately formulated recursive call to itself.
Computers and Technology
1 answer:
Cloud [144]3 years ago
5 0

Answer:

public static String makeLine (int n, char c) {

   if (n ==0)

return "";

   else

       return (c + makeLine(n-1, c));

}

Explanation:

Create a method called makeLine that takes two parameters, int n and char c

If n is equal to 0, return an empty string

Otherwise, call the method with parameter n decreased by 1 after each call. Also, concatenate the given character after each call.

For example, for makeLine(3, '#'):

First round -> # + makeLine(2, '#')

Second round -> ## + makeLine(1, '#')

Third round -> ### + makeLine(0, '#') and stops because n is equal to 0 now. It will return "###".

You might be interested in
Which of the following TCP/IP settings should be configured to specify DNS suffixes to use other than resolving names through a
Harman [31]

Answer:

b. Append these DNS suffixes (in order)

Explanation:

The correct TCP/IP settings to configure to specify DNS suffixes is to append these DNS suffixes in order. This option is normally chosen by default. It is usually selected when the aim is to resolve unqualified computer names present in the primary domain. For example, the name of the computer being used is michael and the parent domain name in question is google.com, this would therefore resolve the computer name to michael.google.com.

5 0
3 years ago
What function does the ALU perform?
mixas84 [53]
The correct answer is B
6 0
3 years ago
Draw a circuit with a 12-volt battery, a 100 ohms resistor in series, and two resistors (each of value 200 ohms) in parallel. Wh
amid [387]

Answer:

200 Ω

Explanation:

Hi there!

Please see below for the circuit diagram.

<u>1) Find the total resistance of the resistors in parallel</u>

Total resistance in parallel equation: \frac{1}{R_T} = \frac{1}{R_1} +\frac{1}{R_2}

Both the resistors measure 200 Ω. Plug these into the equation as R₁ and R₂:

\frac{1}{R_T} = \frac{1}{200} +\frac{1}{200}\\\frac{1}{R_T} = \frac{1}{100}\\R_T=100

Therefore, the total resistance of the resistors in parallel is 100 Ω.

<u>2) Find the total resistance of the circuit</u>

Now, to find the total resistance of the circuit, we must add the 100 Ω we just solved for and the 100 Ω for the other resistor placed in series:

100 Ω + 100 Ω = 200 Ω

Therefore, the total resistance of the circuit is 200 Ω.

I hope this helps!

7 0
3 years ago
Jamie has to enter names, grades, and scores of a group of students into a worksheet. Which option will Jamie use to describe th
Alona [7]

Answer:

a. labels

Explanation:

a. labels b. graphs c. numbers d. formulas

It is the labels, which is the title of each column. For one column we can have the names, for another column, we can have a label grade. and for the third column, we can have the label scores. And the others are the graphs, formulas and the numbers, which are not an option.

6 0
3 years ago
Assume that a kernel is launched with 1000 thread blocks each of which has 512 threads. If a variable is declared as a shared me
Alex

Answer:

The answer to this question is the option "B".  

Explanation:

In this question, the answer is option B which is 1,000 because the kernel is a central part of an operating system. kernel manages the computer and the hardware operations. most especially memory and CPU time. It also sheared a memory variable is allocated to thread blocks. That's why the answer to this question is 1,000.

7 0
3 years ago
Other questions:
  • Carlos owns a hardware store. He currently is not using any software to track what he has in the store. In one to two sentences,
    9·2 answers
  • How to go to a website with an ip address?
    15·1 answer
  • What are some good websites i can use to test my knowledge?
    11·2 answers
  • Assume that an array of integers named a that contains exactly five elements has been declared and initialized. Write a single s
    15·1 answer
  • Which tasks can be completed using the Chart Tools Design tab? Check all that apply.
    5·1 answer
  • Which of the following is true of information systems?
    15·1 answer
  • Which of the following best describes the basic purpose of the internet?
    11·1 answer
  • Please help with coding assignment.
    11·1 answer
  • PLEASE ANSWER
    6·1 answer
  • When software is purchased, a _____ is being bought that gives the purchaser the right to use the software under certain terms a
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!