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
Let |u| = 10 at an angle of 45° and |v| = 13 at an angle of 150°, and w = u + v. What is the magnitude and direction angle of w?
mixer [17]

Given:

|u|=10 at an angle of 45°.

|v|=13 at an angle of 150°.

w=u+v

To find:

Magnitude and direction angle of w.

Solution:

We have,

w=u+v

\theta = 45^\circ, \phi = 150^\circ

Now,

u_x=|u|\cos \theta=10\cos 45^\circ=7.071

u_y=|u|\sin \theta=u_y=10\sin 45^\circ=7.071

v_x=|v|\cos \phi=13\cos 150^\circ=-11.25833

v_y=|v|\sin \phi=u_y=13\sin 150^\circ=6.5

Using these information, we get

R_x=u_x+v_x=7.071-11.25833=-4.18733

R_y=u_y+v_y=7.071+6.5=13.571

\text{Direction angle}=\tan^{-1}(\dfrac{R_y}{R_x})

\text{Direction angle}=\tan^{-1}(\dfrac{13.571}{-4.18733})

\text{Direction angle}=-72.8239

\text{Direction angle}=107.1476

\text{Direction angle}\approx 107.1

Now,

|w|=\sqrt{(|u|\cos \theta +|v|\cos \phi)^2+(|u|\sin \theta +|v|\sin \phi)^2}

|w|=\sqrt{(10\cos(45)+13\cos 150)^2+(10\sin(45)+13\sin 150)^2}

|w|=\sqrt{(10(\dfrac{1}{\sqrt{2}})+13(-\dfrac{\sqrt{3}}{2}))^2+(10(\dfrac{1}{\sqrt{2}})+13(\dfrac{1}{2}))^2}

|w|=14.20236

|w|\approx 14.20236

Therefore, the correct option is D.

4 0
3 years ago
Read 2 more answers
Please answer ASAP! An explanation is a MUST REQUIREMENT in order to receive points and the Brainliest answer. Thank you.
Komok [63]
Hello,

Magnetude is the norm of the vector=V13
Polar angle=arctan(2/3) ==>33.69...°
6 0
3 years ago
What is the value of x? ASAP please
Vikentia [17]
All triangles have a total of 180° in them.

So to find x, simply take 50° and 100° from 180°:

x = 180 - 100 - 50
= 30°

So x = 30°, and thus option D
7 0
3 years ago
Read 2 more answers
Evan was carrying forward a balance of $300 from the previous month. His annual interest rate is 30%. Use computation to determi
sattari [20]

<u>Answer</u>:

The interest charged for this month is $7.5

<u>Step-by-step explanation:</u>

Given:

Principal = $300

Interest = 30%

Time =  1 month

To Find:  

The interest charged for this month = ?

Solution:

we know that the  interest charged = principal \times \text {Interest rate} \times time

1 month can also be written as \frac{1}{12}

Substituting the values,

interest charged:

=> 300 \times 30%  \times \frac{1}{12}

=> 300 \times \frac{30}{100} \times \frac{1}{12}

=> 300 \times \frac{3}{120}

=>\frac{900}{120}

=>\frac{30}{4}

=>\frac{15}{2}

=> 7.5

6 0
3 years ago
Can someone please help me with this?
Levart [38]

Answer:

5 is the answer. hope this help you

5 0
3 years ago
Read 2 more answers
Other questions:
  • Find the volume of the attic of the house.
    9·1 answer
  • Use mathematical induction to prove that the statement is true for every positive integer n. 8 + 16 + 24 + . . . + 8n = 4n(n + 1
    7·1 answer
  • PLEASE HELP ME!!!
    9·2 answers
  • The function f (x comma y )equals 3 xy has an absolute maximum value and absolute minimum value subject to the constraint 3 x sq
    5·1 answer
  • the function f(x)= 0.11 x + 43 relates how much derek pays for phone service, f(x), to the number of minutes, x, used for intern
    6·2 answers
  • I NEED HELP PLEASE! ANYONE WHO ABOUT THE FIFO METHOD?
    10·1 answer
  • What is the value of 3 x squared plus space 4 y squared if x = 2, y = 1, and z = –3?
    6·1 answer
  • 3. Tell whether each statement is true or false Explain how you know a) LCM (7, 18) - LCM (14.18) b) LCM (5,8) - LCM (10,8) c) T
    15·1 answer
  • As x approaches positive infinity, which of the following describes the end behavior for
    13·1 answer
  • What are the prime factors of 1,512?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!