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
luda_lava [24]
3 years ago
10

Assume that the function call operator() is overloaded for data type String in the usual sense of selecting a substring from a l

arger string. For a String object string 1 with the character string "ABCDEFGHI", what string does string 1( 4 , 2 ) return
a. "CDEF".
b. "CD".
c. "EFGHI".
d. "EF".
Mathematics
1 answer:
krek1111 [17]3 years ago
6 0

Answer:

"EF"

Step-by-step explanation:

Given

String1 = "ABCDEFGHI"

Substring : String1(4,2)

To solve this, one must understand the following

1. The function call operator () is used to overload objects of class type.

2. A copy constructor must receive its argument by reference to prevent an otherwise infinite recursion.

3. overload ( ), doesn't mean that one is not creating a new way to call a function; instead, it is a way to create an operator function that can be passed an arbitrary number of parameters

Having pointed out this,

The string to overload goes thus

String1 = "ABCDEFGHI"

The parameters goes thus

String1(4,2)

To represent this properly, we have

("ABCDEFGHI",4,2)

Which means to return 2 strings starting from the 4th index character.

It should be noted that index starts at 0.

So, the character at the 4th index is "E"

Then, we count 2 characters starting from E (i.e. E, inclusive)

This gives

"EF"

So, the returned string is "EF"

You might be interested in
It takes 3 minutes to fill a 60 L bathing pool. What is the average rate in liters per hour
zubka84 [21]
It takes 3 minutes to fill 60L, so it takes 1 hour to fill 1200L.
6 0
3 years ago
Read 2 more answers
How many different situations arise when five coins are thrown into the air?
svet-max [94.6K]
Each coin will either land as a head or a tail.  - 2 possible results.
for 5 coins its 2*2*2*2*2 = 32 different results.
4 0
3 years ago
What is the product of (7 x 10^-5) x (5 x 10^-8) <br> (7 x 10^-5) x (5 x 10^-8) = ? x 10^?
arsen [322]

Answer:

3.5\times10^-^1^2

Step-by-step explanation:

(7 \times 10^-5) \times (5 \times 10^-8)

Evaluate

(7 \times 5)\times(10^-^5\times10^-^8)

35\times10^-^5^-^8

35\times10^-^1^3

35\times10^1\times10^-^1^3

3.5\times10^1^-^1^3

3.5\times10^-^1^2

Thus, the answer is 3.5\times10^-^1^2

<em>~Lenvy~</em>

7 0
2 years ago
Will mark BRAINLIEST!
beks73 [17]

Hello There!

The first one seems alright.

The second one it would be 1/2.

This is because half of the options have “R” on them.

7 0
3 years ago
3x + y = 14<br> y = 5<br> Solve the system of equations
lorasvet [3.4K]

Answer:

X=3, y=5

Step-by-step explanation:

3x + y = 14 equation 1

y=5 equation 2

3x + 5 = 14.    substitute value of y from equation 2 into equation 1

3x=9

x-3

6 0
3 years ago
Other questions:
  • How many squares to shade
    13·1 answer
  • Hannah uses a store gift card to pay for 3 pair of pants priced at $27 each. What is the change in
    7·1 answer
  • Subtract 28 from 54, and then subtract the difference from 32. Which expression means the same as the words ?
    8·1 answer
  • Consider the function represented by 9x+3y = 12 with x as the independent variable. How can this function be
    13·1 answer
  • Equation equivalent to r=1+2sin Ø
    12·1 answer
  • Write 435,000 in scientific notation
    9·2 answers
  • Write the explicit<br> rule for the nth term.<br> Then find a71.<br> {O, -8, -16, -24 ...}
    6·1 answer
  • Find the roots of h(t) = (139kt)^2 − 69t + 80
    12·1 answer
  • What is 713.49 written in standard form​
    5·1 answer
  • Can you please answer this question ​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!