\\\\\\\\\\\\\\\\\\\\\\\\\Operating system///////////////////////
Is the Answer
What what what what what what
Answer:
1.word = "George slew the dragon"
startIndex = word.find('dr')
endIndex = startIndex + 4
drWord = word[startIndex:endIndex]
2. sentence = "Broccoli is delicious."
sentence_list = sentence.split(" ")
firstWord = sentence_list[0]
Explanation:
The above snippet is written in Python 3.
1. word is initialized to a sentence.
Then we find the the occurence of 'dr' in the sentence which is assign to startIndex
We then add 4 to the startIndex and assign it to endIndex. 4 is added because we need a length of 4
We then use string slicing method to create a substring from the startIndex to endIndex which is assigned to drWord.
2. A string is assigned to sentence. Then we split the sentence using sentence.split(" "). We split based on the spacing. The inbuilt function of split returns a list. The first element in the list is assigned to firstWord. List uses zero based index counting. So. firstWord = sentence_list[0] is use to get first element.
Answer:
Written in C++
void number(int n){
if(n%2 == 0)
cout<<2 * n;
else
cout<<5 * n;
}
Explanation:
The programming language is not stated.
However, I answered using C++
This line defines the function as void
void number(int n){
This line checks if the number is even
if(n%2 == 0)
If yes, it doubles the number and prints the output
cout<<2 * n;
If otherwise,
else
It multiplies the number by 5 and prints the output
cout<<5 * n;
}
To call the function from main, use:
number(n);
Note than n must be declared as integer
See attachment
Question 1:
4. it increases the number of employees
Question 2:
2. false
Question 3:
2. it causes great damage to the ozone layer
Question 4:
1. true