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

Given the following code, what indexes must be passed to the substring method to produce the new String with the value "SCORE"?

What indexes to substring produce "fouryears"?
// index 012345678901234567890123456789
String quote = "Four score and seven years ago";
String expr1 = quote.substring(a, b).toUpperCase(); // "SCORE"
String expr2 = quote.toLowerCase().substring(c, d) + quote.substring(e, f); // "fouryears"
a.
b.
c.
d.
e.
f.
Engineering
1 answer:
Ierofanga [76]3 years ago
6 0

Answer:

For expr1 = index 5, length 5

For expr2 = index 0, length 4 and index 21, length 5

string quote = "Four score and seven years ago";

           string expr1 = quote.Substring(5, 5).ToUpper(); // "SCORE"  

           string expr2 = quote.Substring(0, 4) + quote.Substring(21, 5).ToLower(); // "fouryears"

           Console.WriteLine(expr1);

           Console.WriteLine(expr2);

Explanation:

Then code is written in c# and it produces SCORE and f

ouryears

Substring takes 2 arguments, the start of the specific character and the length

You might be interested in
Water circulates throughout a house in a hot water heating system. If the water is pumped at a speed of 0.50m/s through a 4.0-cm
igor_vitrenko [27]

Answer:

velocity and pressure in a 2.6-cm:

P2 = 2.53x10^5Pa, v2 = 1.18m/s

Explanation:

Pressure = P, Velocity = v, Height = h, Diameter = d, Radius= r, Area = A

Area = πr^2

From the question:

v1 = 0.5m/s

d1 = 4cm = 0.04m

r1 = d1/2 = 0.04/2 = 0.02m

Since water was pumped from basement, h1 = 0m

P1 = 3.03x10^5 Pa

A1 = π×0.02×0.02

A1 = 0.0004πm^2

v2 = unknown

d2 = 2.6cm = 0.026m

r2 = d2/2 = 0.026/2 = 0.013m

h2 = 5m

P2 = unknown

A2 = π×0.013×0.013

A2 = 0.000169πm^2

Using continuity equation:

A1v1 = A2v2

0.0004π * 0.5 = 0.000169π * v2

v2 = (0.0004π * 0.5)/(0.000169π)

v2 = 1.18m/s

Applying a Bernoulli principle

P + 1/2*density*v^2 + density*g*h =C

C = constant

P1 + 1/2*density*v1^2 + density*g*h1

= P2 + 1/2*density*v2^2 + density*g*h2

Let g = 9.81m/s

density of water = 1000kg/m^3

(P1-P2) = 1/2* density(v2^2 - v1^2) +(density*g*h2) - (density*g*h1)

(P1-P2) = 1/2* density(v2^2 - v1^2) +

density* g(h2-h1)

(3.03x10^5 - P2)= 1/2*1000 (1.18^2-0.5^2) + 1000(9.81(5-0))

(3.03x10^5 - P2) = 500(1.3924-0.25) + 49050

3.03x10^5 - P2 = 571.2 + 49050

3.03x10^5 - P2 = 49621.2

3.03x10^5 - 49621.2 = P2

P2 = 253378.8

P2 = 2.53x10^5Pa

P2 = 2.53x10^5Pa, v2 = 1.18m/s

7 0
3 years ago
You could be sued if you injure someone while rescuing them if...
navik [9.2K]
I believe number 4 I could be wrong but I think it’s 4
3 0
3 years ago
Read 2 more answers
Which size of impurity atom, smaller impurity atom or larger impurity atom, when located near a dislocation, will nullify some o
svp [43]

Answer:

Smaller impurity atom will nullify some of the compressive strain of a dislocation in a crystal. Because, smaller impurity atoms located near a dislocation creates tensile strain on atoms around it thereby partially nullifying compressive strain at the dislocation.

4 0
3 years ago
Explain any five applications of computer modeling in beams.
coldgirl [10]

Answer:

Explain any five applications of computer modeling in beams.

Explanation:

7 0
3 years ago
Viết một đoạn văn nói về tình bạn
inn [45]

Answer:

Một người bạn luôn quan trọng trong cuộc sống của chúng ta, và mọi người đều thích sự bầu bạn của một người bạn. Tình bạn thật sự rất khó để có được. Trải qua mọi khó khăn, thất bại, người bạn thủy chung sẽ luôn sát cánh. Họ sẽ quan tâm đến bạn mọi lúc, và có được một tình bạn đích thực là một món quà thực sự Có được một người bạn đồng hành trong cuộc sống của bạn là rất quan trọng. Một người có thể hiểu được cảm xúc của bạn, ủng hộ bạn và sát cánh bên bạn trong những lúc tốt và xấu ngay cả khi mọi người quay lưng lại với bạn, một người như thế thật đáng quý biết bao. Đây là người mà chúng tôi gọi là bạn thân nhất của mình.

Explanation:

I hope that helps you

7 0
3 years ago
Other questions:
  • Air flows steadily and isentropically from standard atmospheric conditions to a receiver pipe through a converging duct. The cro
    14·1 answer
  • This is a new technology meant to reduce vehicle roll-overs A. Lane-departure warning B. Anti-lock brakes C. Inspection reports
    7·1 answer
  • The function below takes a two parameters: a list called a_list and a value called a_value. Complete the function to first check
    11·1 answer
  • True/False
    6·1 answer
  • A 11.5 nC charge is at x = 0cm and a -1.2 nC charge is at x = 3 cm ..At what position or positions on the x-axis is the electric
    5·1 answer
  • Write a program to calculate the area of circle, rectangle using a class. The program would prompt a user to select (1) circle o
    15·1 answer
  • HEY Y'ALL!!! WILL GIVE BRAINLEST AND THANKS+A LOT OF POINTS!!!!! So in class our teacher wants to help us think out of the box m
    8·2 answers
  • Select the correct answer. Sean is a recent engineering graduate who has joined a new company. Read the profiles of his colleagu
    12·1 answer
  • 12 inches is equivalent to_ foot.<br><br>A. 1<br>B. 12<br>C. 24<br>D. 36<br>​
    14·1 answer
  • What is the importance of the causal link<br> in work accidents?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!