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
Which of the following is a career that's indirectly linked to careers in web technologies?
leva [86]

Answer:

that would beA

Explanation:

7 0
4 years ago
A user is trying to log into windows on her notebook computer. she enters the correct password for her user account, but the sys
ASHA 777 [7]
Try restarting the PC. I have the same issue on Windows 10 sometimes generally its a network error because Windows 10 has a lot of internet required features... 
7 0
4 years ago
Select the three business advantages of globalization.
Anna007 [38]

Answer:

There is increased collaboration in problem solving.

There are increased business opportunities.

It facilitates ease in communication

4 0
4 years ago
Write MVCTester.java. When the program starts, the initial screen displays a button labeled "add", a blank text area, and a text
Debora [2.8K]

Answer:

Kindly note that, you're to replace "at" with shift 2 as the brainly text editor can't take the symbol

Explanation:

import java.awt.event.*;  

import java.awt.geom.Area;

import javax.swing.*;

class MVCTester implements ActionListener{

JButton b; //button

JTextField t1; //textfiled

JTextArea area; //text area

MVCTester(){

JFrame f=new JFrame("Button Example");

//button

b=new JButton("add");  

b.setBounds(0,0,125,27);  

f.add(b);  

b.addActionListener(this);  

//textfiled

t1=new JTextField();  

t1.setBounds(0,161,125,24);  

f.add(t1);

//textarea

area=new JTextArea();  

area.setBounds(0,28,123,130);  

f.add(area);

area.setColumns (17);

area.setLineWrap (true);

area.setWrapStyleWord (false);

f.setSize(125,225);

f.setLayout(null);  

f.setVisible(true);

}

"at"Override

public void actionPerformed(ActionEvent arg0) {

Control c=new Control(area,t1,b);

}  

}  

class Control {

Control(JTextArea area,JTextField t1,JButton b){

//simple logic getting text of text area adding text of textfiled and setting the text to text area

area.setText(area.getText()+t1.getText()+"\n");

t1.setText("");

}

}

public class Modal{

public static void main(String[] args) {  

MVCTester be=new MVCTester();

}

}

8 0
3 years ago
Read 2 more answers
Antonia runs her own business as a cabinetmaker. What benefit and what drawback does her sole proprietorship entail?
patriot [66]
Total control but Liability is the correct and firm answer you are looking for.. ...
4 0
3 years ago
Other questions:
  • On Sarah’s first day at work she is provided with a range of information technology that she can use to write , edit or create d
    5·2 answers
  • What does editing refer to
    6·2 answers
  • Which method is the best way to keep from running late on the day of a test
    10·1 answer
  • Percy is a lighting technician in a film production. For a shot, the chief lighting technician instructs Percy to get the kind o
    15·1 answer
  • Vlad is the leader of a group; he receives most of the messages from the group members, and he provides most of the information
    6·1 answer
  • A newspaper publishes a negative editorial on how local politicians are dragging their feet in building a new bridge. Select the
    10·2 answers
  • As your textbook explains, Wikipedia is usually the only source you need when
    8·1 answer
  • Files and folders in UNIX can be removed using the
    8·1 answer
  • What can provides access to the only menu in office 2007​
    13·1 answer
  • Which changes the natural world? <br> technology <br> science <br> prototypes <br> feedback
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!