The program is an illustration of loops and conditional statements
<h3>
Loops</h3>
Loops are used to perform repetitive operations.
<h3>
Conditional statement</h3>
Conditional statements are used to make decisions
<h3>The python program</h3>
The program in Python, where comments are used to explain each line is as follows.
#The following is repeated 5 times; i.e. the rows
for i in range(5):
#The following is repeated 5 times; i.e. the columns
for j in range(5):
#For rows 2 and 5
if i == 1 or i== 3:
#For columns 1 and 5
if j == 0 or j == 4:
#This prints *
print('*',end='')
#For other columns
else:
#This prints an empty space
print('',end=' ')
#For other rows
else:
#This prints *
print('*',end='')
#This prints a new line
print()
Read more about loops at:
brainly.com/question/19344465
Answer:
Explanation:
The following code is written in Java and runs a thread every 45 seconds that adds the two counters together and saves them in an integer variable called register. Then prints the variable. If this code runs 5 times it automatically breaks the loop. This can be changed or removed by removing the breakLoopCounter variable.
public static void add_Counters(int counterOne, int counterTwo) {
int register = 0;
int breakLoopCounter = 0;
try {
while (true) {
register += counterOne + counterTwo;
System.out.println(register);
Thread.sleep(45000);
breakLoopCounter += 1;
if (breakLoopCounter == 5) {
break;
}
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
FalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalse
Over a TCP connection, suppose host A sends two segments to host B, host B sends an acknowledgement for each segment, the first acknowledgement is lost, but the second acknowledgement arrives before the timer for the first segment expires is True.
True
<u>Explanation:</u>
In network packet loss is considered as connectivity loss. In this scenario host A send two segment to host B and acknowledgement from host B Is awaiting at host A.
Since first acknowledgement is lost it is marked as packet lost. Since in network packet waiting for acknowledgement is keep continues process and waiting or trying to accept acknowledgement for certain period of time, once period limits cross then it is declared as packet loss.
Meanwhile second comes acknowledged is success. For end user assumes second segments comes first before first segment. But any how first segment expires.
Answer:
Explanation:
a = input("what kind of pet the user has")
if a == 'cat':
print("Too bad")
elif a == 'dog':
print("Lucky you!")