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 way do you swipe in ios to get to the control center
Korvikt [17]

Answer:

Swipe down in the right corner or for older versions swipe from bottom

Explanation:

6 0
2 years ago
: how can you reduce file size so that files can be sent more efficiently across the internet
Rina8888 [55]
You can compress them. ZIP is the most well known protocol.
8 0
3 years ago
A ____ attack is much more substantial than a DoS attack because of the use of multiple systems to simultaneously attack a singl
victus00 [196]

Answer: (D) Distributed denial- of- service (DDoS)

Explanation:

The distributed denial of service attack is one of the type of attack that occur when the multiple system are basically flooded with the resources and the bandwidth.

  • Botnet is one of the example of DDoS as it caused the DOS (denial of service) for the users.
  • This type of attack is more substantial as compared to the DoS attack as they use the multiple system for attack the single target simultaneously.

Therefore, Option (D) is correct.

8 0
3 years ago
When you tell an acquaintance your telephone number, you do not recite the digits one by one at a constant rate, as in "3, 3, 7,
yKpoI14uk [10]

Answer:

chunking and short-term is the correct answer of this question.

Explanation:

chunking is a strategy to enhance a short-term memory.

Chunking is an method used to separate larger numbers that can not be psychologically separated.Chunking is the grouping of words in one sentence into short, important phrases. A chunk is the material segment that is used in many graphical formats, such as PNG etc.

Short-term memory is the knowledge a person is considering or is conscious of. This is also called healthy or main memory.

3 0
3 years ago
What critical-thinking tool is being used when asking the question, Is this information specific enough?
Murljashka [212]
Precision, specificity is related to the accuracy of the information with respect to the subject at hand. Precision is the only answer that makes sense.
6 0
3 years ago
Other questions:
  • Can a computer evaluate an expression to something between true and false? Can you write an expression to deal with a "maybe" an
    13·2 answers
  • How can development in ICT be utilized to speed up the development and integration efforts
    15·1 answer
  • What are the advantages and disadvantages of malware maintenance?
    12·1 answer
  • Which of the following explains the growing need for a standard IT professional licensing program? Check all of the boxes that a
    11·1 answer
  • I have a problem with Instagram.
    11·1 answer
  • In his digital portfolio, Ben wants to locate each work he created. Where can he list details about the work in his digital port
    7·2 answers
  • A ____________ is a collection of commands given a name.
    11·1 answer
  • Random.choice will choose a number between 1 and 100. True False​
    6·1 answer
  • What was revolutionary about Web 2.0?
    5·1 answer
  • A new thread begins its life cycle by transitioning to the ________ state. Group of answer choices new runnable waiting terminat
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!