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
liberstina [14]
4 years ago
13

Assume that word is a variable of type String that has been assigned a value. Assume furthermore that this value always contains

the letters "dr" followed by at least two other letters. For example: "undramatic", "dreck", "android", "no-drip". Assume that there is another variable declared, drWord, also of type String. Write the statements needed so that the 4-character substring word of the value of word starting with "dr" is assigned to drWord. So, if the value of word were "George slew the dragon" your code would assign the value "drag" to drWord. Submit

Computers and Technology
2 answers:
Valentin [98]4 years ago
5 0

Answer:

   String word = "George slew the dragon";

   

   int pos = word.indexOf("dr");    

   String drWord = word.substring(pos, pos+4);

   

   System.out.println(drWord);

Explanation:

Assuming dr is always there, we don't have to check the validity of 'pos'. Normally, you would!

Mazyrski [523]4 years ago
3 0

Answer:

Please see attachment

Explanation:

Please see attachment

You might be interested in
You are a member of the Administrators group on all company computers. You are having difficulty changing permissions for a fold
Delvig [45]

Answer:

Take ownership of the folder and then change permissions.

Explanation:

The best way to solve this issue without losing data in the folder is by taking ownership of the folder and then change permissions.

7 0
3 years ago
How to download goose simulator the game for free<br><br>pls tell me
Hunter-Best [27]
You can’t do it without getting a virus
6 0
3 years ago
Read 2 more answers
How do you site this page??
pickupchik [31]
You take the URL of this page and give credit to this page under the "worked Cited" section in your homework page.
3 0
4 years ago
Using a graphic organizer in the prewriting can do all of the following except what?
ikadub [295]
A. organize the writers thoughts 
<span>B. help narrow the writers topic </span>
<span>C. research a writers story** </span>
<span>D. help make the writing more detailed.</span>
5 0
3 years ago
adding ______around calculations indicates which calculations should be performed first before following the typical order of op
Wittaler [7]
Parentheses! Hope this helped you
5 0
4 years ago
Other questions:
  • In a @return tag statement the description:
    13·2 answers
  • Will a pair of bar magnet ,with keepers on the two ends, act as a magnet
    13·1 answer
  • A collection of methods that can be used by any class, as long as the class provides a definition to override the collection's a
    5·1 answer
  • Some have argued that Unix/Linux systems reuse a small number of security features in many contexts across the system, while Win
    12·1 answer
  • Dave wants to host a website and he needs an operating system that is free of cost. Which operating system should he use?
    11·1 answer
  • Excel allows you to rotate text in a cell counterclockwise by entering a number between -1 degrees and -90 degrees. True or fals
    14·1 answer
  • Click/press _______ to remove the most recently typed text.
    12·2 answers
  • What type of data would a RDBMS store in a linked list, two-way linked list, or B-trees? What are the advantages and disadvantag
    5·1 answer
  • Do you think<br> brain uploading<br> is a good idea?
    7·1 answer
  • Helpppppp meeeeeeeeeeeeeeeeee
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!