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
Consider triangle abc what is the value of y in the triangle
Yakvenalex [24]

Answer:

y = 50

Step-by-step explanation:

All triangle angles add up to 180 degrees.

To set this equation up, you need to add everything given in the triangle and set it equal to 180:

y + y + 80 = 180

<em><u>Add like terms:</u></em>

2y + 80 = 180

<u><em>Subtract 80 from both sides:</em></u>

2y + 80 = 180

     - 80   - 80

___________

2y = 100

<u><em>Divide both sides by 2:</em></u>

y = 50

<u><em>If you're unsure, you can plug in the 50 for y:</em></u>

y + y + 80 = 180

50 + 50 + 80 = 180

100 + 80 = 180

180 = 180

4 0
3 years ago
The rhombus has vertices K(w, 0), M(w, v), and L(u, z). Which of the following could be coordinates of N?
Vitek1552 [10]

the answer would be the third choice which is N(0, z)

3 0
3 years ago
Read 2 more answers
What is the ratio of 24 to 64 in simplest form?
Yakvenalex [24]
24/64= 3/8
so the ratio is 3 to 8 
6 0
3 years ago
Read 2 more answers
Twice a number is increased by 3 is 7
lys-0071 [83]
7-3=4 

4/2=2

The answer is 2
6 0
3 years ago
Read 2 more answers
sherrie is baking a pie for her family. she leaves the room and comes back to 35% of the pie having been eaten before she can pu
GuDViN [60]

Answer: im not sure if there was supposed to be more to this problem, like how much dough was needed before 35% of the pie was eaten???? (if there is more pls comment and ill help)

8 0
3 years ago
Read 2 more answers
Other questions:
  • A boy ate 100 cookies in5 days. Each day he ate6 more than the day before. How many cookies did he eat the first day?
    11·1 answer
  • How many different three-digit numbers can be written using digits from the set 5, 6, 7, 8, 9 without any repeating digits?
    12·2 answers
  • If the cross-section shown has an approximate area of 78.54 cm2, what is the approximate volume of the cylinder if its height is
    15·1 answer
  • Can you please help I have no idea how to I’m stuck
    10·1 answer
  • Does anyone know how to answer this question? it's number four on limits.
    5·1 answer
  • Once Tony made his car payment, he deposited a check for $295.76, withdrew $40 and then bought $35.99 worth of gas. What is his
    10·1 answer
  • Bob's tire outlet sold a record of tires last month one sales ma sold 165 tires which was 60 percent of the record what was the
    15·1 answer
  • What is the 20th term of the arithmetic sequence?
    6·2 answers
  • Plz help i suck with this so plzz
    12·1 answer
  • Find the percent of change for #1-5
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!