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
Since the rules cannot address all circumstances, the Code includes a conceptual framework approach for members to use to evalua
Veseljchak [2.6K]

Answer:

more than one safeguard may be necessary.

Explanation:

The conceptual framework can be used to developed as well as construct through a process of the qualitative analysis. The approach includes the in the frameworks for identifying and evaluating the threats to compliance with the rules.

But since the rules formed cannot always address all the circumstances, the Code includes to evaluate the threats to the compliance of more than one safeguards that are necessary.

8 0
3 years ago
Please help me with this coding problem :)
leonid [27]

Answer:

ll and lll

Explanation:

list dont be a looser

8 0
3 years ago
Kellyn needs to move Slide 8 of his presentation up so that it becomes Slide 6. What best describes how he can do this using the
uranmaximum [27]

Answer:

C

Explanation:

Most programs for slides allow the individual to click and drag a slide where it belongs.

8 0
3 years ago
Read 2 more answers
Which access object cannot be used to enter or edit data
kap26 [50]

Answer:

Should be B. table !

6 0
2 years ago
Read 2 more answers
. Write a function called is_sorted that takes a list as a parameter and returns True if the list is sorted in ascending order a
aalyn [17]

Answer:

There are multiple ways to solve the given problem, I will be presenting the most simple and easy way of solving this problem in few lines of code.

Python code:

def is_sorted(user_list):

   return user_list == sorted(user_list)

user_list=input("Please enter a list: ")

user_list = user_list.split()

print(is_sorted(user_list))

print("Your list: ", user_list)

Explanation:

A function is_sorted is created which takes a list as input and using the sorted() function of python which returns true when the list is sorted in ascending order and returns false when the list is not sorted in ascending order.

Driver code includes getting input list from the user and using split() function to create a list separated by space then printing the output of is_sorted function and in the last printing the contents of that list.

Output:

Please enter a list: 1 3 6 9

True

Your list:  ['1', '3', '6', '9']

Please enter a list: 15 7  2 20

False

Your list:  ['15', '7', '2', '20']

8 0
4 years ago
Other questions:
  • Write a program that reads in text from standard input (hint: use Scanner) and prints out the number of words in the text. For t
    5·1 answer
  • Whats the Sioux City school wifi?
    15·2 answers
  • What is the leading use of computers
    15·2 answers
  • Sulfur content is measured in
    11·1 answer
  • 2) Search the Web for two or more sites that discuss the ongoing responsibilities of the security manager. What other components
    15·1 answer
  • What is the difference between word processing software and email?
    12·2 answers
  • . A possible data for source that could be used when completing a mail merge could be a(n)… : *
    13·2 answers
  • You make an online purchase of a hooded sweatshirt with the logo of the Dallas Cowboys. The next time you log on, your screen ha
    13·1 answer
  • Which of the following types of computers is typically used by governments and hospitals and can support hundreds of users?
    6·2 answers
  • An epic games service is unavailable at the moment
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!