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
A self improvement plan should begin with planning how you will accomplish your goal.
Artist 52 [7]

Answer:

True

Explanation: The first step is to make a goal. The second step is to plan how you will accomplish you goal. The third and final step is to accomplish your goal.

4 0
3 years ago
Read 2 more answers
A(n) ________ is a wonder of miniaturization combining a CPU, GPU, and sundry other support logic onto a single silicon die, sav
erma4kov [3.2K]

Answer:

system on a chip (SoC)

Explanation:

4 0
2 years ago
Renee just got on the freeway to go to her cousin's house in Denver. She is driving 50 miles per hour. Her sister Kim left one h
defon

let's say they catch-up to each other after t hour.

so

in t hour distance travelled by Renee

d = speed × time = 50t

in t hour distance travelled by Kim

d = speed × time = 60(t-1) + 0×1 = 60(t-1)

Note: here kim didn't covered any distance in first hour and in rest t-1 hour it travelled all distance

now.as distance travelled by both is same so

60(t-1) = 50t

60t -60 = 50t

adding 60 both sides

60t = 50t+60

subtracting 50t both sides

60t -50t = 50t+60 - 50t

10t = 60

dividing by 10 both sides

t = 60/10 = 6

so in 6 hour both will catch-up to each other

3 0
3 years ago
In a relational database, a ____ would ensure that two customers with the same name don’t get confused with each other.
earnstyle [38]

Answer: Primary key

Explanation: Relational databases are those databases which are commonly found in the form of tables . It works in the relation pattern for accessing the data in the database

Primary key is a major factor which is found in the relational databases for the identification of the data in the table's column.It is considered as the unique value that corresponds to the values of rows in the table of relational database.

6 0
3 years ago
Suh my lil cuddys.... tell me what ur favorite candy is.....
LenKa [72]

Answer:

ok imma little scared, but my fav candy would have to be reeses peanut butter cups or hershey's with almonds.

8 0
3 years ago
Other questions:
  • Discuss Hashing and how it is utilized within the IT industry. Also, discuss how Hashing can improve our sorting and searching r
    12·1 answer
  • FOR ALL PLATO USERS:
    10·2 answers
  • Hi guts gyt edgsahgflefljwegfwygafbhdshdnvcashD
    13·1 answer
  • Which character formatting effect makes text appear in a small font size below the midpoint of a line of text
    6·1 answer
  • 1. Answer the following questions: a. What are the different types of number system? Name them.​
    8·1 answer
  • What does it mean to prioritize tasks?
    12·2 answers
  • So im new how exactly does this point system work???​
    6·1 answer
  • What is the name of the function below?<br><br> function go(){<br> alert("hello everybody");<br> }
    10·1 answer
  • Write a Python program that uses three variables. The variables in your program
    12·1 answer
  • What is your idea for creating a new and fresh Gaming experience around viewing occasions for Mike's?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!