Answer:
// This program is written in C++
// Comments are used for explanatory purpose
// Program starts here
#include<iostream.h>
#include<stdlib.h>
int main()
{
// Declare variables
int num, selectno;
string status;
randomize();
//Generate random number;
num=rand()%10000;
// Prompt to guess a number
cout<<"You have only 10 tries\nTake a guess: ";
int tries = 0;
while (tries != 10)
{
cin>>selectno;
if(selectno == num){
cout<<"You passed at the "<<count+1<<" attempt";
tries = 10;
}
else
{
cout<<"You failed. Take another guess\n You have "<<10 - count + 1 <<" attempts";
}
tries++;
if(tries >= 10)
{
break;
}
}
return 0;
}
Answer:
routers
Explanation:
<h2><em><u>Fill in the blanks</u></em></h2>
The<u> routers </u> in an internet are responsible for receiving and forwarding packets through the interconnected set of networks and making routing decisions based on knowledge of the topology and traffic/delay conditions of the internet.
Answer:
I am going to use the Python programming language to answer this. The source code is given below:
print("Enter your tweet here")
user_tweet = input()
decoded_tweet = user_tweet.replace('TTYL', 'talk to you later')
print("This is the decoded tweet: ")
print(decoded_tweet)
Explanation:
In the program the replace() module was used to replace 'TTYL' with 'talk to you later.'
Attached is the screenshot of the output.
Answer:
shortNames = ['Gus', 'Bob','Zoe']
Explanation:
In this assignment, your knowledge of list is been tested. A list is data structure type in python that can hold different elements (items) of different type. The general syntax of a list is
listName = [item1, "item2", item3]
listName refers to the name of the list variable, this is followed by a pair of square brackets, inside the square brackets we have items separated by commas. This is a declaration and initialization of a list with some elements.
The complete python code snippet for this assignment is given below:
<em>shortNames = ['Gus', 'Bob','Zoe']</em>
<em>print(shortNames[0])</em>
<em>print(shortNames[1])</em>
<em>print(shortNames[2])</em>