subject

Ihave a couple of questions on java for my homework
21229
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 andk. 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.
20861
a palindrome is a string that reads the same forwards or backwards; for example dad, mom, deed (i. e., reversing a palindrome produces the same string ). write a recursive, boolean -valued method , ispalindrome that accepts a string and returns whether the string is a palindrome.
a string , s, is a palindrome if:
s is the empty string or s consists of a single letter (which reads the same back or forward), or
the first and last characters of s are the same, and the rest of the string (i. e., the second through next-to-last characters ) form a palindrome.
20864
a 'array palindrome' is an array which, when its elements are reversed, remains the same (i. e., the elements of the array are same when scanned forward or backward) write a recursive, boolean -valued method , ispalindrome, that accepts an integer -valued array , and a pair ofintegers representing the starting and ending indexes of the portion of the array to be tested for being a palindrome. the function returnswhether that portion of the array is a palindrome.
an array is a palindrome if:
the array is empty (0 elements ) or contains only one element (which therefore is the same when reversed), or
the first and last elements of the array are the same, and the rest of the array (i. e., the second through next-to-last elements ) form a palindrome.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
What is a society that has moved to the internet rather than relying on physical media called
Answers: 2
question
Computers and Technology, 22.06.2019 14:30
What percentage of companies is projected to use social media to locate new employees in 2012
Answers: 2
question
Computers and Technology, 22.06.2019 21:00
Describir textbook icon_person mira los dibujos y describe lo que estΓ‘ pasando. usa los verbos de la lista.
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
Why were most movies from the late 1890s until the early 1930s only filmed in black and white? there were only a few people who could afford the technology to produce color motion pictures back then. audiences did not want color motion pictures until later. the film used to make color motion pictures often overheated, which was a safety hazard, so it was generally not allowed. color films had to be hand-colored, frame by frame.
Answers: 3
You know the right answer?
Ihave a couple of questions on java for my homework
21229
assume the availability of a m...
Questions
Questions on the website: 13722361