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
Nana76 [90]
2 years ago
6

Assuming that s and t are Strings, which of the following code fragments are such that the value returned by s.indexOf( t ) befo

re the code is executed is equal to the value of the int n after the code is executed?
I. int n = -1;
int tSize = t.length();
boolean found = false;
while ( !found && tSize <= s.length() )
{
n++;
if ( t.equals( s.substring( 0, tSize ) ) )
found = true;
else
s = s.substring( 1 );
}
if ( !found )
n = -1;
II. int n = -1;
int sSize = s.length();
int tSize = t.length();
boolean found = false;
while ( !found && n + tSize + 1 <= sSize )
{
n++;
if ( t.equals( s.substring( n, n + tSize ) ) )
found = true;
}
if ( !found )
n = -1;
III. int n = 0;
int sSize = s.length();
int tSize = t.length();
boolean found = false;
while ( !found && n + tSize <= sSize )
{
if ( t.equals( s.substring( n, n + tSize ) ) )
found = true;
n++;
}
if ( found )
n--;
else
n = -1;
A. I only
B. II only
C. III only
D. I and II only
E. I, II, and III
Computers and Technology
1 answer:
KengaRu [80]2 years ago
5 0

Answer:

What programming language is this

Explanation:

You might be interested in
Topic: Video Games.
Butoxors [25]

Answer:

Fire Emblem

Explanation:

4 0
3 years ago
A program that performs handy tasks, such as computer management functions or diagnostics is often called a/an ____________.
Elodia [21]

Answer:

DOS

Explanation:

Disk operating

4 0
2 years ago
What is the best java 3d modeler library?
LenaWriter [7]
I believe its "Thinking Universe"
5 0
3 years ago
What's exactly the difference between "Library" and "Framework" ? ​
Mariana [72]
Answer:

The key difference between a library and a framework is “Inversion of Control”. When you call a method from a library, you are in control. But with a framework, the control is inverted:the framework calls you

Explanation:

A library performs specific, well-defined operations.

A framework is a skeleton where the application defines the "meat" of the operation by filling out the skeleton. The skeleton still has code to link up the parts but the most important work is done by the application.

Examples of libraries: Network protocols, compression, image manipulation, string utilities, regular expression evaluation, math. Operations are self-contained.

Examples of frameworks: Web application system, Plug-in manager, GUI system. The framework defines the concept but the application defines the fundamental functionality that end-users care about.
8 0
3 years ago
We need goku and naruto fight story someone
lana [24]

Answer:

goku comes in and turns super sayain  naruto come in with kurama and naruto get goku with a rasagen and geku is still fist fightin while naruto is using his kurama and turns into kurama and knocks out goku now naruto thinks he won and goku IS HITIN HIM WITH A KAMEKAMEHA GOKU IS SIROUS NOW

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Carlos owns a hardware store. He currently is not using any software to track what he has in the store. In one to two sentences,
    9·2 answers
  • Put the following numbers in order from greatest to least:
    13·1 answer
  • Read each scenario, and then select the best wireless device for the worker’s needs. A trucker is constantly on the road. He fre
    8·2 answers
  • Read the following paragraph:
    9·2 answers
  • Please help quickly!!! which of the following is not a peripheral?
    8·2 answers
  • Easter Sunday is the first Sunday after the first full moon of spring. To compute the date, you can use this algorithm, invented
    15·1 answer
  • Match the component to its function. resistor inductor capacitor battery transistor This component stores a temporary charge. ar
    7·2 answers
  • A Computer Programmer who wants to be surrounded by a large number of like-minded coworkers should take a job with one of the na
    14·2 answers
  • A local bank has just one branch. It sets up a peer-to-peer network for all devices on the system. The bank would like to be abl
    8·2 answers
  • How to hack a I'd Indian brainly bot​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!