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
What animal is perry the platypus ​
valkas [14]

Answer: Agent P or simply Perry

Explanation:

4 0
3 years ago
Read 2 more answers
You have been tracking your exercise routine, which involves running, lifting weights, yoga, and stretching. You want to see wha
Harrizon [31]

The best chart to see the data distribution for the exercise routine would be a pie chart. Using Microsoft Excel, you can input each data point you have for all you exercise routine category, and generate a pie chart which will show you the percentage for each category in comparison to the total.


5 0
3 years ago
Read 2 more answers
Why will my note 5 not download videos from the web?
meriva
Try downloading an app if the phone is not doing it.
7 0
3 years ago
Answer quick plzzz I only have 2 hours
Nana76 [90]

Answer:

option 2

Explanation:

8 0
2 years ago
Read 2 more answers
Care should be taken whenever you post comments or photos to any social media or other websites, because each of these online ac
REY [17]

Answer:

True

Explanation:

Building your personal brand requires extreme care when it comes to social media presence. In the age of internet there is nothing hidden, so whatever you post or comment will be seen by your audience and it can go in either way. It can either make your brand or break it. It is of utmost importance to leave a pleasant and positive impact on your audience. One should not indulge in inappropriate or controversial debates and try to avoid being too personal on social media.  

6 0
3 years ago
Other questions:
  • Assume that x is a double variable that has been initialized. Write a statement that prints it out, guaranteed to have a decimal
    5·1 answer
  • The purpose of the ________ element is to describe the contents of a table.
    15·1 answer
  • In Outlook 2016, what are the three format options when sending an email message? Check all that apply.
    7·1 answer
  • What is a strictly layered pattern, provide an example of its usage.
    13·1 answer
  • Technician A says that the ECT and IAT sensors can be tested by using a digital multimeter or a scan tool. Technician B says tha
    12·1 answer
  • Which one is not an operating system?1.mac 2.Microsoft office3.Iso.3.Android
    11·1 answer
  • Consider the code below. When you run this program, what is the output if the temperature is 77.3 degrees Fahrenheit?
    6·1 answer
  • The term structure, as it relates to programming, refers to the decisions you make to design your program to best meet its objec
    11·1 answer
  • Write one line Linux command that performs the required action in each of the problems given below: (a) Find the difference in t
    12·1 answer
  • 1. This tab displays the related commands which are grouped as Pages, Tables, Illustrations, Links, Header and Footer, Text, Sym
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!