subject
Mathematics, 24.02.2020 23:42 sarah8479

Assume the availability of a method named makeLine that can be passed a non-negative integer n and a character c and return a String consisting of n identical characters that are all equal to c. Write a method named printTriangle that receives two integer parameters n and k. If n is negative the method does nothing. If n happens to be an even number, its value is raised to the next odd number (e. g. 4-->5). Then, when k has the value zero, the method prints a SYMMETRIC triangle of O's (the capital letter O) as follows: first a line of n O, followed by a line of n-2 O's (indented by one space), and then a line of n-4 O's (indented by two spaces), and so on. For example, if the method received 5,0 (or 4,0) it would print: OOO O Note: in the above output, the first line contains 0 spaces before the first O, the next line 1 space, and so on. Note: These instructions state what the method does when k is zero, but it is up to you, the programmer, to determine what it does when k is not zero and use it for your advantage. The method must not use a loop of any kind (for, while, do-while) to accomplish its job. The method should invoke makeLine to accomplish the task of creating Strings of varying lengths.

ansver
Answers: 1

Another question on Mathematics

question
Mathematics, 21.06.2019 20:30
Solve each quadratic equation by factoring and using the zero product property. x^2 + 18x = 9x
Answers: 2
question
Mathematics, 21.06.2019 22:00
20 points 1. your friend, taylor, missed class today and needs some identifying solutions to systems. explain to taylor how to find the solution(s) of any system using its graph. 2. taylor graphs the system below on her graphing calculator and decides that f(x)=g(x) at x=0, x=1, and x=3. provide taylor some feedback that explains which part of her answer is incorrect and why it is incorrect. f(x)=2x+1 g(x)=2x^2+1
Answers: 2
question
Mathematics, 21.06.2019 23:30
In a right triangle δabc, the length of leg ac = 5 ft and the hypotenuse ab = 13 ft. find: b the length of the angle bisector of angle ∠a.
Answers: 1
question
Mathematics, 22.06.2019 00:30
How do i i solve this equation? -18 = x/3 + 3
Answers: 1
You know the right answer?
Assume the availability of a method named makeLine that can be passed a non-negative integer n and a...
Questions
question
Mathematics, 09.11.2020 19:40
question
History, 09.11.2020 19:40
question
Mathematics, 09.11.2020 19:40
question
Mathematics, 09.11.2020 19:40
question
Mathematics, 09.11.2020 19:40
question
Computers and Technology, 09.11.2020 19:40
question
Chemistry, 09.11.2020 19:40
question
Physics, 09.11.2020 19:40
question
Biology, 09.11.2020 19:40
question
Chemistry, 09.11.2020 19:40