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]
4 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]4 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
An air conditioner is designed to bring 10,000 ft3/min of outside air (90°F, 29.8 inches Hg, 88% relative humidity) to 40°F, the
jarptica [38.1K]

Answer:

rate of condensation= 1.81 gal/min

volumetric flow rate= 9223 ft³/min

Explanation:

See attached pictures.

3 0
4 years ago
Put four red LED as a straight line and connect each of them to a corresponding analog output. Connect a potentiometer to a 5 Vo
N76 [4]

Explanation:

There has been no information about related to which programming language is to be used, writing code algorithm.

Defining I/O's ;

Analogue output

A01, A02, A03,AO4

Analogue Input;

AI_1   // potentiometer input

// Based on controller used, assign channels to I/O's

// code

int voltage

Voltage = AI_1;

If (Voltage > 0 && Voltage < 1.25)

 {

   A01 = voltage

   A02 = 0;

   A03= 0

   AO4= 0

 }

If (Voltage > 1.25 && Voltage < 2.5)

 {

   A01 = 1.25

   A02 = (Voltage -1.25);

   A03= 0

   AO4= 0

 }

If (Voltage > 2.5 && Voltage < 3.75)

 {

   A01 = 1.25

   A02 = 1.25

   A03=  (Voltage - 2.5);

   AO4= 0

 }

else

 {

   A01 = 1.25

   A02 = 1.25

   A03=  1.25

   AO4= (Voltage - 3.75);

 }

return

3 0
3 years ago
Which best describes the body in terms of simple machines?
alex41 [277]

Answer:B

Explanation:

5 0
4 years ago
This elementary problem begins to explore propagation delayand transmission delay, two central concepts in data networking. Cons
telo118 [61]

Explanation:

(a)

Here, distance between hosts A and B is m meters and, propagation speed along the link is s meter/sec

Hence, propagation delay, d_{prop} = m/sec (s)

(b)

Here, size of the packet is L bits

And the transmission rate of the link is R bps

Hence, the transmission time of the packet,  d_{trans} = L/R

(c)

As we know, end-to-end delay or total no delay,

\mathrm{d}_{\text {nodal }}=\mathrm{d}_{\text {proc }}+\mathrm{d}_{\text {quar }}+d_{\max }+d_{\text {prop }}

Here,  $\mathrm{d}_{\text {rroc }}$ and $\mathrm{d}_{\text {quat }}$ \\Hence, $\mathrm{d}_{\text {rodal }}=\mathrm{d}_{\text {trass }}+\mathrm{d}_{\text {prop }}$ \\We know, $\mathrm{d}_{\text {trax }}=\mathrm{L} / \mathrm{R}$ sec and $\mathrm{d}_{\text {vapp }}=\mathrm{m} / \mathrm{s}$ sec\text { Hence, } {d_{\text {nodal }}}=\mathrm{L} / \mathrm{R}+\mathrm{m} / \mathrm{s} \text { seconds }

(d)

The expression, time time $t=d_{\text {trans }}$ means the\at time since transmission started is equal to transmission delay.

As we know, transmission delay is the time taken by host to push out the packet.

Hence, at time $t=d_{\text {trans }}$ the last bit of the packet has been pushed out or transmitted.

(e)

If \ d_{prop} >d_{trans}

Then, at time $t=d_{\text {trans }}$ the bit has been transmitted from host A, but to condition (1),  the first bit has not reached B.

(f)

If \ d_{prop}

Then, at time $t=d_{\text {trans }}$, the first bit has reached destination on B

Here,s=2.5 \times 10^{8} \mathrm{sec}

\begin{aligned}&\mathrm{L}=100 \mathrm{Bits} \text { and }\\&\mathrm{R}=28 \mathrm{kbps} \text { or } 28 \times 1000 \mathrm{bps}\end{aligned}

It's given that \ d_{prop} =d_{trans}

Hence,

        \begin{aligned}\ & \frac{L}{R}=\frac{m}{s} \\m &=s \frac{L}{R} \\&=\frac{2.5 \times 10^{8} \times 100}{28 \times 1000} \\&=892.9 \mathrm{km}\end{aligned}

5 0
3 years ago
The expression with an AND operator ________ when the expression on its left is false and so it does not evaluate the expression
MatroZZZ [7]
It is the short circuit
3 0
4 years ago
Other questions:
  • If the open circuit voltage of a circuit containing ideal sources and resistors is measured at 8 , while the current through the
    14·2 answers
  • Water enters a tank of diameter Dt steadily at a mass flow rate of m&amp; . An orifice at the bottom with a diameter of Do allow
    11·1 answer
  • Whats a person who enters the electrical trade
    7·2 answers
  • 10 10 10 10 10 10 10 10 10 10
    6·2 answers
  • If you deposit $ 1000 per month into an investment account that pays interest at a rate of 9% per year compounded quarterly.how
    14·1 answer
  • I need help with this assignment. ​
    15·1 answer
  • Please help i really don't understand.
    8·1 answer
  • Scrooge McNugget wants to store information (names, addresses, descriptions of embarrassing moments, etc.) about the many ducks
    6·1 answer
  • What happens if you leave your car on while pumping gas
    8·1 answer
  • How much profit does the fossil fuel industry make
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!