Answer:
#include <iostream>
#include <cstring>
using namespace std;
void replacePeriod(char* phrase) {
int i = 0;
while(*(phrase + i) != '\0')
{
if(*(phrase + i) == '.')
*(phrase + i) = '!';
i++;
}
}
int main() {
const int STRING_SIZE = 50;
char sentence[STRING_SIZE];
strcpy(sentence, "Hello. I'm Miley. Nice to meet you.");
replacePeriod(sentence);
cout << "Updated sentence: " << endl;
cout << sentence << endl;
return 0;
}
Explanation:
- Create a function called replacePeriod that takes a pointer of type char as a parameter.
- Loop through the end of phrase, check if phrase has a period and then replace it with a sign of exclamation.
- Inside the main function, define the sentence and pass it as an argument to the replacePeriod function.
- Finally display the updated sentence.
In this question, we are given
,
-
A certain list, L, contains a total of n numbers, not necessarily distinct, that are arranged in increasing order.
- L1 is the list consisting of the first n1 numbers in L.
- L2 is the list consisting of the last n2 numbers in L.
Explanation:
As per the information given in statement 1, 17 is a mode for L1 and 17 is a mode for L2.
Therefore, we can infer that
,
- 17 must occur in L1, either same or a greater number of times as any other number in L1.
- 17 must occur in L1, either same or a greater number of times as any other number in L2.
As all elements in L are in ascending order, we can also conclude that
-
Each number between last occurrence of 17 in L1 and the first occurrence of 17 in L2 must be equal to 17 only.
- Therefore, 17 occurs either same or greater number of times as any other number in L.
- Thus, 17 is a mode for L.
However, from this statement, we cannot conclude anything about the mode of L1, L2, or L.
Hence, statement 2 is not sufficient to answer the question.
Therefore, 17 is a mode for L1 and 17 is a mode for L2.
The correct option is B.
Having a bachelor degree from a college gives the highest returns on investments. People who go to college usually secure high paying jobs compare to their counterparts who have less education.
The type of college one attends also matter, for instance in USA, the college in the first position, which gives the highest return on investment is Massachusetts Institute of Technology [MIT].
The answer is (c) infinite loop
<span>Boolean expressions can be combined by using a logical operator to create compound expressions. A boolean expression is an expression that takes into account and evaluates specific data, which is in the form of true and/or false. A compound expression is merely a statement of expressions.</span>