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
Is 5 5/6 + 1 3/4=5 1/12 reasonable
ira [324]

Answer:

No, it is unreasonable.

Step-by-step explanation:

5/5/6+1/3/4=35/6+7/4

=70/12+21/12

=91/12

=7 7/12

4 0
2 years ago
At Sally's Hair Salon there are three hair stylists. 36% of the hair cuts are done by Chris, 26% are done by Karine, and the res
Marina86 [1]

Answer:

Probability that their hair was done by Amy is 0.475.

Step-by-step explanation:

We are given that Sally's Hair Salon there are three hair stylists. 36% of the hair cuts are done by Chris, 26% are done by Karine, and the rest are done by Amy.

Let the Probability of hair cutting done by Chris = P(C) = 0.36

Probability of hair cutting done by Karine = P(K) = 0.26

Probability of hair cutting done by Amy = P(A) = 0.368

Also, let NS = event that customer is not satisfied with his cutting

So, Probability that customers are not satisfied given that their hair cutting is done by Chris = P(NS/C) = 0.05

Probability that customers are not satisfied given that their hair cutting is done by Karine = P(NS/K) = 0.06

Probability that customers are not satisfied given that their hair cutting is done by Amy = P(NS/A) = 0.08

Now, a customer leaving the salon is selected at random. If the customer is not satisfied, the probability that their hair was done by Amy is given by = P(A/NS)

For finding the above probability we will use the concept of Bayes' Theorem;

SO, P(A/NS)  =  \frac{\text{P(A) \times P(NS/A)}}{\text{P(C) \times P(NS/C) + P(K) \times P(NS/K) +P(A) \times P(NS/A) }}\frac{P(A) \times P(NS/A) }{P(C) \times P(NS/C) +P(K) \times P(NS/K) +P(A) \times P(NS/A) }

                     =  \frac{0.38 \times 0.08}{0.36 \times 0.05+0.26 \times 0.06+0.38 \times 0.08}

                     =  \frac{0.0304}{0.064}

                     =  <u>0.475</u>

<em>Hence, the probability that their hair was done by Amy is 0.475.</em>

3 0
3 years ago
I need help on this.
den301095 [7]

Answer:

yes

Step-by-step explanation:


8 0
3 years ago
Read 2 more answers
A cable TV company charges $25
olga nikolaevna [1]

Answer:

D

Step-by-step explanation:

75=(4*25)=C

  • it means 25*3 which is the new price for the Fifth month should be equal to 75
  • <em><u>7</u></em><em><u>5</u></em><em><u> </u></em><em><u>=</u></em><em><u>7</u></em><em><u>5</u></em><em><u>=</u></em><em><u>C</u></em>
5 0
2 years ago
If f (x) = -2x2 + 6, find f (-3).
Margarita [4]

Answer:

Step-by-step explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • What helps in determining the reliability of a person wit reguard?
    5·1 answer
  • If DM 5 37, find the value of r.<br>A) 7<br>B) 15<br>C) 17<br>D) 18​
    7·1 answer
  • Belleville High School offers classes on three different foreign languages. Let A be the event that a student is in eleventh gra
    6·2 answers
  • the equation of a circle is x - y + 1 = 0 . if one end of the diameter is ( 3, p) and other end is ( a, 2 ) , find the equation
    8·1 answer
  • Gina is buying bags of apples at the grocery store. Each bag of apples has five apples in it. Which equation shows the relations
    7·1 answer
  • What fraction is equal to 1/4
    11·2 answers
  • You and your friend spent a total of $15 for lunch. Your friend's lunch cost $3 more than yours did. How much did you spend for
    14·1 answer
  • Hellooopppppppppppppppp
    12·1 answer
  • What is the horizontal shift for the absolute value function below? Explain how you know using complete sentences.
    10·1 answer
  • What is a bond and how do you make money from it?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!