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
The graph of f(x) and g(x) are shown below Which of the following is the graph of (g-f)(x)
anyanavicka [17]

Answer:  (g-f)(x)=-4x

Explanation: According to the graph, line created by function f(x) passes through the points (1,-3) and (0,0) and similarly, line created by the function passes through the points (1,1) and (0,0).

Thus, we can find the equation of the lines with help of formula y-y_1=\frac{y_2-y_1}{x_2-x_1} × (x-x_1)

so, equation of line created by function f(x)

y+3=\frac{3-0}{0-1}×(x-1)

y+3=\frac{3}{-1}×(x-1)

y+3=-3x+3

y=-3x thus function f(x)=-3x

similarly, equation of line created by function g(x)  

y=x thus function g(x)=x

Now, we have to find out, (g-f) (x)= g(x)-f(x)= -3x-x= -4x

                                                                                             

                                                                                                                                                       


5 0
3 years ago
Read 2 more answers
7(y+3)=5y+8<br> Is this <br> A.Solution<br> B.No Solution<br> C. Infinite Solution
faust18 [17]

First, let's use the Distributive Property to make our equation easier to solve. Remember that the Distributive Property says the following:

a(b + c) = ab + ac


Using this, we can multiply the 7 out to the y and 3. This gives us:

7y + 21 = 5y + 8


Now, let's solve for y:

2y + 21 = 8

2y = -13

y = - \dfrac{13}{2}


We can see that there is one solution for this equation because y is equal to one definite value after solving. Thus, our answer is A, one solution.  

3 0
3 years ago
A cupcake shop earns $950 a day. The total amount of earning varies directly with the number of
Lostsunrise [7]

the answer is $4750.

4 0
3 years ago
Read 2 more answers
If Nicole saves $0.05 every day how much money will she have in 3 years
gavmur [86]

Answer:

$54.75

Step-by-step explanation:

0.05 x 365 = 18.35

18.25 x 3 = 54.75

7 0
2 years ago
Read 2 more answers
Write this statement as a conditional statement in the form “if p, then q.”
Nezavi [6.7K]

Answer:

if three points are all located on the same line, then, the points are collier points.

Step-by-step explanation:

the if or p statement is called the hypothesis.

the then or q statement is called the conclusion.

6 0
2 years ago
Other questions:
  • Jennifer's teacher has marked this problem as one to recheck, but Jennifer cannot determine what she has done incorrectly. Ident
    7·1 answer
  • The temperature of the tardigrades is very important. Your colleague has cubed the temperature by accident . If he reported that
    14·2 answers
  • Population in 1990 was 134 million. In 2000 it was 139 million. What was it in 2014
    6·1 answer
  • How many elements does each of these sets have where a and b are distinct elements?
    12·1 answer
  • I need help in 3 pls
    11·1 answer
  • Region A has a total of 81,218,576 acres. Estimate the number of acres owned by the government in Region A. Choose the correct e
    8·1 answer
  • Solve k/2 - 2k + 1=7
    6·2 answers
  • What is the chance of either getting all heads or no heads on 4 tosses?
    7·1 answer
  • What function equation is represented by the graph?
    5·1 answer
  • If two triangles are congruent, which of the following statements must be true? Check all that apply. A. The corresponding sides
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!