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]
3 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]3 years ago
5 0

Answer:

What programming language is this

Explanation:

You might be interested in
Google+ hangouts is connected to what other social media site?
Lynna [10]

Google Plus is the social media site that is connected with Hangouts.

 

To add, Google Plus<span> <span>is an interest-based </span></span>social network<span> <span>that is owned and operated by </span></span>Google. G<span>oogle's fourth foray into social networking, experienced strong growth in its initial years, although usage statistics have varied, depending on how the service is defined.<span> </span></span>

3 0
3 years ago
Of all the database types we have studied, which database seems most appropriate for a startup building a new note-taking app fo
Deffense [45]

Answer:

<u>documents database</u>

Explanation:

This database is most appropriate because we need to remember that a <u>note-taking app</u> would not necessarily need too many functions apart from the basics text input operations.

Also, we need to note that the digital infrastructure required to build a documents database, is very convenient for a startup because they may have lesser resources.

7 0
3 years ago
Read 2 more answers
Harry wants to change the background of all of his presentation slides. Which slide will enable him to make this change to all t
Alexxx [7]

Harry would need to change the "color scheme" to change the background of all his presentation slides.

3 0
3 years ago
Read 2 more answers
Naruto vs Sasuke. Who would win?
max2010maxim [7]
Naruto would win, no doubt
3 0
3 years ago
Which of the following contains information about which keywords are bringing visitors to your website?
Natasha_Volkova [10]
I would go with C. but it would depend on what you have recently been studying to know for sure since lingo can change from person to person.  Good luck! :)
8 0
3 years ago
Other questions:
  • While Angela is making modifications to Katie’s Word document, she would like to inform Katie of the reasoning for the change. W
    10·1 answer
  • A step commonly used for Internet vulnerability assessment includes __________, which occurs when the penetration test engine is
    9·1 answer
  • A workplace is where people _____. a. do work b. find new jobs c. go when they are unemployed d. read advertisements for job ope
    15·1 answer
  • What are two ways to access the options for scaling and page orientation? click the home tab, then click alignment, or click the
    10·1 answer
  • Validation ensures that a website looks good.<br> True or False
    9·1 answer
  • Using a Mouse
    8·2 answers
  • CPT, which is used to code procedures in an office, is an example of a/an
    12·1 answer
  • A + B (AC (B +C’) D) = A + BD
    10·2 answers
  • Help meee pleaseeee
    5·1 answer
  • Larry has created a web page using HTML 4.01. He hasn’t included the declaration in the file. When he opens the page in a browse
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!