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
X +4/2 = 9<br> What’s z?
kirill [66]

Answer:

x+4/2=9       x=14

Step-by-step explanation:

14+4=18 and 19/2 is equal to 9. Therefore the answer is 14.

6 0
3 years ago
X + 2∕5 = 1∕3 for x.
Stels [109]

Answer:

?

Step-by-step explanation:

?

8 0
3 years ago
How to calculate 99 : 5​
Goryan [66]

Answer:

19.8

Step-by-step explanation:

99/5= 19.8

5 0
3 years ago
Anjali's Bikes rents bikes for $15.24 plus $2.61 per hour. Kathryn paid $30.90 to rent a bike. For how many hours did she rent t
tensa zangetsu [6.8K]
Kathryn rented the bike for about 1.7 hours.
7 0
3 years ago
Read 2 more answers
Suppose 100 people all toss a hat into a box and then proceed to randomly pick out a hat. what is the expected number of people
tatuchka [14]
1 person because there is 1 in 100 chance that you get your hat back
4 0
3 years ago
Other questions:
  • X is a distance of 4 units to the left of 0.
    12·1 answer
  • What is the arc length if theta = 2pi / 3 and the radius is 4cm
    8·1 answer
  • A band leader randomly selects 2 students out of 75 band members. if you and your brother are both band members, what is the pro
    7·2 answers
  • Janet rents a car while spending her vacation traveling in New Zealand. When she returns the car, she has driven 925 miles and u
    15·1 answer
  • : Change these speed into miles per hour<br>(b) 48km/h​
    10·1 answer
  • What does the simple interest stand for? Interest = Principal x Rate x Time Interest = Per unit x Rate x Time Interest = Price x
    8·1 answer
  • Find the length of the missing side. Express your answer in simplest radical form.
    6·1 answer
  • Can U pls help with this number in the sequence​
    5·1 answer
  • What is the y-intercept of the line that passes through the points (2,-1) and (-3,9)
    12·1 answer
  • How can I do this. 0.025 as a percentage of 12.4. Rounded to two decimal places?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!