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
C++
vichka [17]

Answer:

#include <iostream>

#include <map>  

using namespace std;

int main()

{

   map<int, int> numbers;

   cout << "Enter numbers, 0 to finish" << endl;

   int number;

   while (true) {

       cin >> number;

       if (number == 0) break;

       numbers[number]++;

   }

   for (pair<int, int> element : numbers) {

       std::cout << element.first << ": occurs " << element.second << " times" << std::endl;

   }

}

Explanation:

One trick used here is not to keep track of the numbers themselves (since that is not a requirement), but start counting their occurrances right away. An STL map< > is a more suitable construct than a vector< >.

4 0
3 years ago
Which of the following is most often added to safety glasses to provide better protection from impact and flying particles? A. S
Vesnalui [34]

the answer is side shields cause the side shields gives more protection to the eyes than just the lens because the flying objects and particals can still get into your eyes even with the safty glasses but with the side shields the total risk of injury percentage goes down because the side shields helps blocks the flying objects and particals that are trying to get into your eye from the side

8 0
3 years ago
Is there apps/ websites like brainly?
Virty [35]

Answer:

Mathpix Snip, Socratic, Microsoft Math Solver....etc.

Explanation:

Hope this helps! :)

6 0
3 years ago
Read 2 more answers
The term that refers to the standard computer language for creating web pages is called:
Leni [432]

CSS or HTML5

fdjsafhjdshfjdkslahfkdsajf

8 0
3 years ago
2 examples of free, proprietary and online software for multimedia presentations (two of each) ._.
photoshop1234 [79]

Answer:

1. PowerPoint online

2. Goógle Slides

Explanation:

There is a various free, proprietary, and online software for multimedia presentations available for use. Some of which include:

1. PowerPoint online: this is an online and free version of Microsoft Office PowerPoint software. Some of its features include text formatting, use of animations, cloud storage among others.

2. Goógle Slides: This is a product of Goógle to make the multimedia presentation of documents available online. It also offers many feature including cloud storage.

4 0
3 years ago
Other questions:
  • The concept of vertical farming allows agriculture to occur when there is not enough___Available .
    13·1 answer
  • When a Firewall is a hardware interface, it is referred as a
    6·1 answer
  • If you're doing a relational comparison, which filter would be available?
    15·1 answer
  • (Game Design) A float is a blank space, used as a placeholder in an array<br><br> True or false
    13·1 answer
  • Which tool allows multiple users to dynamically update a document at the same time? Question 3 options: Google Docs OneDrive Exc
    14·1 answer
  • Written and artistic expressions are protected by
    8·1 answer
  • Which principle suggests that specific single responsibility interfaces are better than one general purpose interface?
    13·1 answer
  • In Subtractive empathy, the counselor responses gives back less (or distorts) than what the client has said. slightly add someth
    14·1 answer
  • Use the drop-down menus to complete each statement. Two main versions of Outlook are the desktop app and the app. The has limite
    15·2 answers
  • When it comes to credit scores, why is having a
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!