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
OlgaM077 [116]
3 years ago
6

Write a recursive method public static String reverse(String str) that computes the reverse of a string. For example, reverse("f

low") should return "wolf". Hint: Reverse the substring starting at the second character, then add the first character at the end. For example, to reverse "flow", first reverse "low" to "wol", then add the "f" at the end.
Computers and Technology
1 answer:
Aneli [31]3 years ago
5 0

Answer:

Explanation:

StringRecursiveReversal.java

public class StringRecursiveReversal {

   static String reverse1 = "";

   public static String reverse(String str){

       if(str.length() == 1){

           return str;

       } else {

           reverse1 += str.charAt(str.length()-1)

                   +reverse(str.substring(0,str.length()-1));

           return reverse1;

     }

   }

   public static void main(String a[]){

       StringRecursiveReversal srr = new StringRecursiveReversal();

       System.out.println("Result: "+srr.reverse("flow"));

   }

}

Output :

Result: wolf

You might be interested in
Kyra is teaching a photography class. She would like her students to share photos. She would also like the students to be able t
SIZIF [17.4K]

Answer:

A blog.

Explanation:

A blog can be defined as an informative or discussion-based website that is updated regularly and published over the internet. The informations that are posted on a blog are usually done chronologically and it includes pictures, videos, music, movies, novels, etc.

In this scenario, Kyra is teaching a photography class. She would like her students to share photos, be able to review other students' photos and offer feedback.

Hence, the technology Kyra should use is a blog because it would avail the users (students) to post photos, make comments on blog posts and review items posted by others.

6 0
3 years ago
Write a pseudocode thats accept and then find out whether the number is divisible by 5 ​
andreyandreev [35.5K]

Answer:

input number

calculate modulus of the number and 5

compare outcome to 0

if 0 then output "divisible by 5"

else output "not divisible by 5"

Explanation:

The modulo operator is key here. It returns the remainder after integer division. So 8 mod 5 for example is 3, since 5x1+3 = 8. Only if the outcome is 0, you know the number you divided is a multiple of 5.

5 0
3 years ago
True or false: within a database, fields can be added, deleted and edited but never moved.
nata0808 [166]

Answer:true bra

Explanation:

6 0
3 years ago
Which code snippet is the correct way to rewrite this in Semantic HTML?
xxMikexx [17]

Answer:

<div id="header">

<h1>Waketech</h1>

</div>

<header><h1>Waketech</h1></header>

Explanation:

I think thats the answer your welcome

8 0
1 year ago
Which of the following is not an Error Style for data validation?
Brut [27]

Based on the Microsoft Excel data validation, the option that is not an Error Style for data validation is the <em><u>choice that does not show an error alert.</u></em>

Given that there is no option available, the best way to answer this question is to show the types of Error Styles for data validation available.

<h3>Different types of Error Style for data validation</h3>
  • Stop style: this will bring the option of "Retry, " "Cancel, " and "Help."

  • Warning style: this will show "Continue," with options of "Yes," "No," "Cancel," and "Help."

  • Information Style: this will ask you to input the whole number with the option of "Ok," "Cancel," and "Help."

Hence, in this case, it is concluded that the Error Style for data validation is Stop, Warning, and Information Style.

Learn more about Error Style for data validation here: brainly.com/question/18497347

4 0
2 years ago
Other questions:
  • Write a program that reads a stream of integers from a file and writes only the positive numbers to a second file. The user shou
    5·1 answer
  • If a tv was showing a flat black or blue screen or had "snow", what steps would you take to fix it? Give an example of the direc
    11·1 answer
  • JavaBeans are?A special Java classfileServletsAppletsA Special form of JSPNone of Given
    8·1 answer
  • According to the textbook, the definition of transition is
    13·1 answer
  • Please help it would mean to world to me❤️ (WORD)
    13·1 answer
  • Write a function findWithinThreshold that identifies the elements of a given array that are inside a threshold value. Takes the
    13·1 answer
  • People who enjoy working with their hands might enjoy a career as a/an
    9·1 answer
  • PLZ ANSWER THESE QUESTIONS FOR 30 POINTS AND BRAINLIEST!
    9·1 answer
  • I make a budget of my 1st Gamer PC its good?
    9·1 answer
  • What is smarta Art ? ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!