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
Pavel [41]
3 years ago
14

Consider the following method substringFound, which is intended to return true if a substring, key, is located at a specific ind

ex of the string phrase. Otherwise, it should return false.
public boolean substringFound(String phrase, String key, int index)
{
String part = phrase.substring(index, index + key.length());
return part.equals(key);
}
Which of the following is the best precondition for index so that the method will return the appropriate result in all cases and a runtime error can be avoided?
A. 0 <= index < phrase.length()
B. 0 <= index < key.length()
C. 0 <= index < phrase.length() + key.length()
D. 0 <= index < phrase.length() - key.length()
E. 0 <= index < phrase.length() - index
Computers and Technology
1 answer:
Nadusha1986 [10]3 years ago
3 0

D. 0 <= index < phrase.length() - key.length()

You might be interested in
The answer for 1 and 2
Mrrafil [7]
1. A.  It is basically the definition of a political cartoon.
2. D. They used newspaper, protesting, and marches.
<span />
6 0
4 years ago
8.9 Code Practice
jolli1 [7]

Answer: Here you go, change it however you like :)

Explanation:

v = [24, 20, 29, 32, 34, 29, 49, 46, 39, 23, 42, 24, 38]

usr = int(input("Enter number: "))

print(f"Index: {v.index(usr)}") if usr in v else print(-1)

5 0
3 years ago
Read 2 more answers
What is 1 of the rules for naming variables?
vova2212 [387]

Answer:

<h3>Rules for Naming Variables</h3><h3>The first character must be a letter or an underscore (_). You can't use a number as the first character. The rest of the variable name can include any letter, any number, or the underscore. You can't use any other characters, including spaces, symbols, and punctuation marks.</h3>

<em><u>#</u></em><em><u>M</u></em><em><u>a</u></em><em><u>r</u></em><em><u>k</u></em><em><u>a</u></em><em><u>s</u></em><em><u>b</u></em><em><u>r</u></em><em><u>a</u></em><em><u>i</u></em><em><u>n</u></em><em><u>l</u></em><em><u>e</u></em><em><u>s</u></em><em><u>s</u></em><em><u>p</u></em><em><u>l</u></em><em><u>e</u></em><em><u>a</u></em><em><u>s</u></em><em><u>e</u></em><em><u>✅</u></em>

3 0
3 years ago
If i paid $37.20 for 12 gallons of ice cream how many would 1 quart of ice cream cost
Lapatulllka [165]

Answer:

$0.78

Explanation:

5 0
3 years ago
Read 2 more answers
What is pseudocode? O A way of describing a set of instructions in text form using plain english O A diagrammatic representation
Marat540 [252]

The definition of pseudocode is that; A: A way of describing a set of instructions in text form using plain English

<h3>What is Pseudocode? </h3>

In computer science, pseudocode is defined as a plain language description of the steps in an algorithm or another system.

Now, the way Pseudocode works is that it often makes use of structural conventions of a normal programming language to be utilized for human reading instead of machine reading.

Pseudocode usually omits details that are essential for machine understanding of the algorithm, such as variable declarations and language-specific code.

Read more about Pseudocode at; brainly.com/question/11623795

8 0
3 years ago
Other questions:
  • If your vehicle leaves the pavement for any reason, remember to take your foot off the gas pedal, hold the wheel firmly, and
    12·2 answers
  • A recent antivirus scan on a server detected a Trojan. A technician removed the Trojan, but a security administrator expressed c
    6·1 answer
  • Which business document is usually written in block style with the body tedt aligned along its left margin?
    9·1 answer
  • Which statement below is not true of EFS
    7·2 answers
  • Type the correct answer in the box. Spell the word correctly. Which framework can be used to develop cross-platform applications
    15·2 answers
  • HELP I WILL MARK BRAINLIEST!!! I NEED ASAP!!!
    5·1 answer
  • Shipments of compact digital cameras dropped by 42% due to the industry being unable to adjust to changes in the ________. a. ec
    11·1 answer
  • Explain the four misconceptions about entrepreneurship.
    7·1 answer
  • What is the purpose of flight simulator programs, and what are some of the benefits of using them?
    5·2 answers
  • What action should you take if you become aware that sensitive compartmented information has been compromised
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!