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
If the perimeter of a square garden is 84 feet, what is the area of the garden?
EastWind [94]
441ft²     (i believe this is the answer, idk though, i might be wrong sorry)
6 0
4 years ago
Read 2 more answers
In a library where the ratio of men to women is 1 to 1, _____ of the total members are men
kolbaska11 [484]
Wouldn't that be half, or 50%?

5 0
3 years ago
Read 2 more answers
Six more than the quotient of a number and 2 equals 8
ikadub [295]
Let number=x

(X/2)+6=8

First subtract 6 on each side to isolate X on one side.

(X/2)=2

Now to fully isolate X by itself, just multiply 2 on each side.

X=4
7 0
3 years ago
Read 2 more answers
Angle relationships with parallel lines please help can someone answer
aleksley [76]

Answer:

x=56

Step-by-step explanation:

when it's parallel lines they're just equal idk how to explain sorry twji44ktgrohubi

6 0
3 years ago
Which of the following describes the probability distribution below?
Serhud [2]

Answer:

B. Median is greater than the mean and the majority of data points are to the right of the mean.

Step-by-step explanation:

Mean = sum(x × p(x))

= (1×0.1)+(2×0.15)+(3×0.2)+(4×0.45)+(5×0.1)

= 3.3

Probability of more than 3.3 is:

0.45 + 0.1 = 0.55 > 0.5

4 0
3 years ago
Other questions:
  • 2x + 5y + 7x equals
    12·2 answers
  • A school has a boy to girl ratio of 6:7. If there are 288
    10·2 answers
  • Find EF given E(-7, -2) and F(11, 3). Round your answer to the nearest thousandth (3 decimal places).
    13·1 answer
  • Thirteen students entered the business program at Sante Fe College 2 years ago. The following table indicates what each student
    14·1 answer
  • Kevin has an equal number of dimes, nickel and quarters in his piggy bank. He randomly picks a coin, replaces it, and picks anot
    11·1 answer
  • Kelso is in charge of a bake sale. On each table, t, there will be a platter of 24 cookies and 2 bowls of brownies with b browni
    11·1 answer
  • PLEASE ANSWER ASAP. WILL MARK AS BRAINLYEST
    6·2 answers
  • An urn has 6 white balls and 4 orange balls if Sam chooses 5 balls at random from the urn what is the probability that he choose
    6·1 answer
  • Expand and simplify 2(5x - 1) – (2x - 5) ​
    9·1 answer
  • I WILL GIVE 20 POINTS TO THOSE WHO ANSWER THIS QUESTION RIGHT NOOOO SCAMS AND EXPLAIN WHY THAT IS THE ANSWER
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!