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
This morning when Paul turned on his computer at work, it would not boot. Instead, Paul reported that he heard a loud clicking n
AVprozaik [17]

Answer: his cpu fan may not be working properly

Explanation:

8 0
3 years ago
What is the FaFASA4caster used for
pav-90 [236]

Answer:

The FAFSA4caster is a free financial aid tool from the federal government that allows you to practice filling out the Free Application for Federal Student Aid (FAFSA) and estimate the financial aid you could receive based on student and family assets and income.

6 0
3 years ago
A growing number of large organizations have built internal Web sites that provide opportunities for online social networking am
Flauer [41]

Answer:

True

Explanation:

The ideology of building internal web sites  for online social networking among employees is aimed towards productivity.

<em>For example, when an employee is finding a specific job difficult and is connected with someone on the social websites created by the organization, the employee will get help in no time to ensure that the organization achieve maximum productivity.</em>

It will constantly keep each employee informed on the organizations policies, goals and achievements.

However, there are shortcomings of online social networking in the workplace:

  1. If not properly managed, It might become addictive and will lead to low employee productivity.
  2. Great intellectual minds might be exposed to negative influences from within the organisation

8 0
3 years ago
Please helpppppppppppppppppp please I’m stuck!
Vinvika [58]

do u know thw muffin man

3 0
3 years ago
Microsoft Word cannot be used to create personalized web<br> pages.<br> OTrue<br> False
Georgia [21]

Answer:

False

Explanation:

Because Microsoft can be used to create personalized web

5 0
2 years ago
Other questions:
  • considering that two variables counters and accumulators are important in loop design. What would be their purpose?
    9·1 answer
  • What should you do before cleaning the top of a storage battery and rinsing it with fresh water?
    12·1 answer
  • Proper numeric keyboarding technique includes:
    15·1 answer
  • The interaction between information technology and organizations is influenced___________.A) solely by the decision making of mi
    12·1 answer
  • PrimeFactorization.java: Write a program that begins by reading in a series of positive integers on a single line of input and t
    12·1 answer
  • Why the internet is not considered a mass medium in Africa​
    13·2 answers
  • Plsss help anyone PLSSSSS ​
    13·1 answer
  • 1. Which one of the following is true about screening interviews?
    7·1 answer
  • Please help with question
    14·1 answer
  • Figure out what this says:<br><br> ?driew tib a kool ti seoD
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!