Answer:
Assuming an upstander is someone that opposes cyberbullying:
(1) Call them out
(2) Report the behavior to proper moderation authority
(3) Tell the person to block messages from the cyberbully
I don't really know what else you want from this.
Cheers.
#This is a way without a loop
friends = list(map(str,input("Enter Names: ").split()))
print(sorted(friends))
#This is a way with a loop (for&&while)
friends = list(map(str,input("Enter Names: ").split()))
cool = True
while cool:
cool = False
for i in range(len(friends)-1):
if friends[i] > friends[i+1]:
coo = friends[i]
friends[i] = friends[i+1]
friends[i+1] = coo
cool = True
print(friends)
Answer:
a. 1 is a packet, 2 is data, 3 is a frame.
Explanation:
And what is not mentioned is segment which used TCP/UDP and is part of Transport layer. The packet carries the destination and sender IP address, and is part of the Network Layer. The frame has the Mac address of destination device and senders device and is part of data link layer.
Hence segment has no IP address, hence b. is not correct. Also, data cannot have the IP Address, and Frame has the MAC address, Hence, the above answer. And this arrangement is part of Data Encapsulation.
Also keep in mind data can be anything like a series of bits, or any and it can or not have a header.
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.