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
Bumek [7]
3 years ago
10

Consider the recursive method whose definition appear below. Why? public static String mysteryString (String s){ if(s.length()==

1) return s; else return s.substring(s.length() – 1) + mysteryString(s.substring(0, s.length() – 1)); } What is the result of the following call?
System.out.println(mysteryString("computer"));
Computers and Technology
1 answer:
Marizza181 [45]3 years ago
6 0

Answer:

retupmoc

Explanation:

1.) Anwser will be retupmoc

because

public static String mysteryString(String s){

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

return s;

}

else{

return s.substring(s.length() -1) + mysteryString(s.substring(0, s.length()-1));

}

}

In this program input is "computer" . So the function mysteryString(String s) it does

return s.substring(s.length() -1) + mysteryString(s.substring(0, s.length()-1));

so when it enters the first time ??s.substring(s.length() -1) and it will be give you 'r' then it calls the function recursively by reducing the string length by one . So next time it calls the mysteryString function with string "compute" and next time it calls return s.substring(s.length()-1)? + mysteryString(s.substring(0,s.length-1)) so this time it gives "e" and calls the function again recursively . It keeps on doing till it matched the base case.

so it returns "retupmoc".

You might be interested in
The data-linking feature that allows Internet users to skip directly from a highlighted word to a related file in another comput
tamaranim1 [39]

Answer:

Hypertext

Explanation:

According to my experience on information technology, I can say that based on the information provided within the question the term being mentioned is called Hypertext. Like described in the question this term refers to a software system which shows as a highlighted piece of text that allows a user to immediately be taken to another system with information associated with the highlighted text that was clicked.

If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
Read 2 more answers
Select the function of keypunches that were used as one of the earliest input devices. A. It was used to control the cursor on t
natali 33 [55]

Answer:

Select the function of keypunches that were used as one of the earliest input devices.(1 point) -It was used for punching holes in the paper at relevant ...

Explanation:

3 0
1 year ago
A point is named by a lowercase letter. <br> a. True<br> b. False
Alik [6]
That is B False m8 that means mate btw xD please say thank you :P
4 0
3 years ago
Read 2 more answers
When making an assembly of design what command is most.commonly used?
Schach [20]
There are two common command lines used in creating design assembly. The 'push' and 'pull' command. Both allows you to get parts from the original predelivered content's source desgian    and recreate the design faster and with less memory.
6 0
2 years ago
This is Tim’s first job. He is not familiar with how the Internet is used at the workplace. Match the applications of Internet u
Gala2k [10]

Answer:

A - 2

B - 3

C - 5

D - 4

E - 1

Explanation:

A. Virtual private network : 2

This is very useful when you have to work from home or visiting a client and need access to files/applications just like if you were at the office.

B. Email :  3

Yes, this is basically why the Internet was created in the first place.

C. Social networking sites : 5

Social networks are indeed a great marketing tool, allowing to target potential customers very precisely.

D. Search engines :  4

Yes, to find information about new products for the company, how the competitors are doing and so on.

E. Video and web conferencing:  1

Another great tool for employees working from home for example, or for employees located in an office at the other side of the country.

4 0
3 years ago
Other questions:
  • What should not be compromised when trying to meet standards and deadlines?
    12·1 answer
  • While designing web pages for mobiles, the page content should be extensive such that the readers get the opportunity to explore
    5·2 answers
  • You want to place a video from the internet to your desktop. what process do you use?
    15·1 answer
  • What describes the basic transaction data such as its date, purpose, and amount and includes cash receipts, canceled checks, inv
    13·1 answer
  • How do you change the text style on brainly mobile ?
    12·1 answer
  • Your program is going to compare the distinct salaries of two individuals for the last 5 years. If the salary for the two indivi
    15·1 answer
  • A cable that connects the computer to the printer is an example of<br> A.hardware<br> B.software
    13·2 answers
  • Global address list characteristics
    11·1 answer
  • The notes added to slides can be seen during the presentation. TRUE OR FALSE​
    13·1 answer
  • What is the difference between Brainly.com and Brainly.in? Ive been wondering because im not signed in under Brainly.in.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!