int main() {
string simon_Pattern;
string user_Pattern;
int userScore;
int i;
user_Score = 0;
simon_Pattern = "RRGBRYYBGY";
user_Pattern = "RRGBBRYBGY";
for (i = 0; i <= simson_pattern.length; i++) {
if (simon_Pattern[i] == user_Pattern[i]) {
user_Score = user_Score + 1;
} else {
break;
}
}
cout << "userScore: " << user_Score << endl;
return 0;
}
Here it uses two string variable to store “simson’s pattern and user’s pattern”. Then a “for loop” is executed till the end of the string. Inside the for loop both the strings are compared character by character and when found the score is added. If not for loop is exited and finally the score is displayed.
Answer:
A.
thanks later baby HAHAHAHAHAA
Answer:
TCP is a connection-oriented protocol
UDP does not acknowledge a receipt of data
Explanation:
TCP (Transmission Control Protocol) is a protocol to transfer data, this is one of the most important protocols on the entire internet, this method was implemented from the beginning of the network.
UDP (User Datagram Protocol) this is a protocol faster than TCP because this method doesn't establish a connection to sent data, in this case, always sent data, but TCP is more secure than UDP, and for that UDP is used to transfer music or videos, and TCP websites and database.
UDP doesn't need acknowledgment is done by UDP, is only concerned with speed.