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
Evaluate each logarithm. Do not use a calculator. Log (125)(1/25)
svetlana [45]

Answer:

-2/3

Step-by-step explanation:

Log125(1/25)=x

Raise each side to the base of 125

125^Log125(1/25)=125^x

1/25 = 125^x

Rewrite 25 as a power of 5  and 125 as a power of 5

1 / 5^2 = 5^3^x

The if power is in the denominator, we can bring it to the numerator by making it negative

5^-2 = 5^3^x

We know that a^b^c = a^(b*c)

5^-2 = 5^(3*x)

Since the bases are the same, the exponents are the same

-2 = 3x

Divide by 3

-2/3 = 3x/3

-2/3 =x

6 0
3 years ago
When jerry drives 204 miles on the highway, his car uses 6 gallons of gasoline . How much gasoline would his car use if he drive
Luba_88 [7]

Answer:

15

Step-by-step explanation:

6 0
3 years ago
Solo necesito ayuda con las que están en amarillo las otras ya están realizadas
GalinKa [24]
Solo tienes que divide
4 0
4 years ago
A piece of stained glass in the shape of a right triangle has sides measuring 8 centimeters 15 centimeters and 16 centimeters wh
Wittaler [7]
The answer would be...

a= 59.43 sq. cm
3 0
3 years ago
HELP ME PLEASE !!!!
lyudmila [28]

For this one, an easy way to solve it is to break it down into parts.  First lets convert 5 feet to inches.  

Multiply the number of feet by how many inches are in one foot.  

5 times 12= 60 in

Now just add the like terms

60 in + 2 in= 62 inches.

Now we see that Sarah is 62 inches tall, now we can convert to centimeters the same way.

62 times 2.54= 157.48

So that makes C your answer, Sarah is 157.48 cm tall.

5 0
3 years ago
Other questions:
  • Who do you solve 10=z+6 as a one step equation
    10·2 answers
  • How many right angles are there in 270 degrees
    5·1 answer
  • 2 ln(x + 2) − ln(−x) = 0
    9·1 answer
  • If C(x) is the cost of producing x units of a commodity, then the average cost per unit is c(x) = C(x)/x. Consider the cost func
    15·1 answer
  • Select the correct answer.<br> If 25% of a number is 100, what is the number?
    10·1 answer
  • Arthur wrote that 15 – 14.7 = 3.
    6·1 answer
  • A scuba diver dives 750 feet underwater, swims up 375 feet, and then swims down 225 feet. After all of that where is the diver a
    10·1 answer
  • What is the algebraic description for a transformation that translates the
    12·1 answer
  • Help me plzzzzzzzzzzzzzzzzzzz
    12·1 answer
  • Find the value of two numbers if their sum is 21 and their difference is 5
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!