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
adell [148]
3 years ago
6

How many times is the function wordScramble() called in the given program? public class WordScramble { public static void wordSc

ramble(String rem, String scr) { if (rem.isEmpty()) { System.out.println(scr + rem); } else { for (int i = 0; i < rem.length(); ++i) { wordScramble((rem.substring(0, i) + rem.substring(i + 1, rem.length())), (scr + rem.charAt(i))); } } } public static void main(String args[]) { wordScramble("ab", ""); } } 4 2 5 3
Computers and Technology
1 answer:
Ainat [17]3 years ago
6 0

Answer:

The answer is "2"

Explanation:

  • In the given java program code, a class WordScramble is declared, inside the class, a static method wordScramble is declared, that accepts two string parameter that is "rem and scr".
  • Inside the method a conditional statement is used in the if the block it checks rem variable value is empty so, it will add rem and scr value.  Otherwise, it will go to else block in this a loop is defined, which calls the method, which calculates rem length that is 2, and this method call two times to rearrange the values.
  • In the next step main method is defined that calls wordScramble method, which passes only one argument "ab" in its first parameter.
  • This method accepts one string value, in which there are two numbers   "a and b" that's why the method will run two times.  
You might be interested in
You have been hired to set up a network for XYZ Enterprises. What factors will you consider to determine the type of network nee
Margarita [4]

Answer:

I would say if it is a multiple choice

Explanation:

q3 or q5 would be the best ones to pick from in my eyes.

3 0
4 years ago
Read 2 more answers
Were is the hype house
balandron [24]

Answer:

LA

Explanation:

where the rich people live

8 0
3 years ago
Read 2 more answers
Minerals can form deep inside Earth’s crust by
ipn [44]

ANSWER:

Minerals can form deep inside earth's crust by the crystallization of melted materials. There are two ways on how minerals are formed: crystallization of melted materials and the crystallization of materials dissolved in water.

Hope this helps!

5 0
3 years ago
According to your course, two benefits of a cloud-based system are_ and_
vodomira [7]
Data backup and collaboration.
4 0
4 years ago
Ok so um does anyone know how i can use a divided by sign on computer?
Maslowich
You can just put “/“ to represent dividing
6 0
3 years ago
Read 2 more answers
Other questions:
  • Sarah is working on a project in which she needs to record all the extracurricular activities in her college. Her college teache
    5·1 answer
  • Which of these jobs would be most appropriate for someone who majors in computer engineering? ANSWER FAST PLEASE
    15·2 answers
  • Give sally sue specific suggestions on how she can improve her powerpoint skills.
    6·1 answer
  • If anything is changed on an already-tested module, regression testing is done to be sure that this change hasn’t introduced a n
    13·1 answer
  • 1. What are copyright laws? (6 points)
    15·1 answer
  • Which feature is used to summarize data from multiple worksheets but does not require that the data be in the same location on e
    12·1 answer
  • Which 3D game has Bentley the Bear collect gems while avoiding enemy trees, bees, ghosts, skeletons, and Berthilda the witch?
    9·1 answer
  • Hoda is creating a report in Access using the Report Wizard. Which option is not available for adding fields using the wizard?
    15·2 answers
  • After Alexandra installed new software, she set it up to perform in a certain way. She is _____. changing the peripherals linkin
    10·1 answer
  • Several small stores rent space within a larger shopping centre. The owners of the shopping centre have provided a physical netw
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!