1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
masya89 [10]
3 years ago
11

The following code segment is a count-controlled loop going from 1 to 5. At each iteration, the loop counter is either printed o

r put on a queue depending on the result of Boolean function RanFun(). (The behavior of RanFun() is immaterial. At the end of the loop, the items on the queue are dequeued and printed. Because of the logical properties of a queue, this code segment cannot print certain sequences of the values of the loop counter. Is the following output possible using a queue: 1 2 3 4 5?
Computers and Technology
1 answer:
quester [9]3 years ago
4 0

Answer:

True.

Explanation:

For all the count values, if Ranfun() returns true then all the values of count would be printed. Then the sequence of count values printed would be 1 2 3 4 5. Also for all the values of count if Ranfun() returns false then all the values would be enqueued. When we try to dequeue elements from queue we would get them in the same order of their entry into the queue. Thus, the sequence would be 1 2 3 4 5. Hence, we can say that this output sequence is possible. TRUE.

You might be interested in
Implemente a função ao lado, que recebe um preço e um booleano indicando se já está com desconto ou não. Se o preço for maior qu
Andrew [12]

Answer:

function pecoDesconto(preco, estaComDesconto) {

 

 let p = preco;

 let desconto = estaComDesconto;

 if(p > 100 && desconto == false){

   return "Quero pechinchar";

 }else{

   return "Negócio fechado";

 }

}

Explanation:

function pecoDesconto(preco, estaComDesconto) {

 

 // Implemente a função ao lado, que recebe um preço//

 let p = preco;

// variavel que indica desconco//

 let desconto = estaComDesconto;

//Se o preço for maior que 100 e não estiver com desconto, a função deve retornar Quero pechinchar.//

 if(p > 100 && desconto == false){

   return "Quero pechinchar";

   //Caso contrário, deve retornar Negócio fechado

 }else{

   return "Negócio fechado"

 }

}

só te faltou ler com atenção, e um pouco de logica!

7 0
2 years ago
The it department is reporting that a company web server is receiving an abnormally high number of web page requests from differ
Talja [164]
<span>In the scenario in which the IT department is reporting that a company web server is receiving an abnormally high number of web page requests from different locations simultaneously the DDoS security attack is occurring.
</span>DDos stands for Distributed Denial of Service<span> . This </span><span>attack is an attempt to make an online service unavailable by overwhelming it with traffic from multiple sources.</span>
8 0
2 years ago
What should every Software Engineer know about Software Architecture?
Alenkinab [10]
<span>!UML (all of them)
2.Flowchart (more for understanding a real world process of some kind; like a business process)
3.Data model including Bachman (if you don't need to at least understand your data, how it is stored versus a model, i.e., Bachman then you are doing it wrong and your schema could be simplistic)
This is 3 different examples</span>
6 0
3 years ago
In the 1960s, techniques were developed that allowed individuals to fool the phone system into providing free access to long dis
ycow [4]

Answer:

A

Explanation:

4 0
3 years ago
How does a router handle a packet destined for a network that is not listed in the routing table?
kogti [31]
The packet is dropped or discarded. By default, a router will send packets to a network that has been listed in the routing table. If it happens that the network is not listed, the packet will be discarded or dropped. Packets that do not have a default route or gateway of last resort are dropped.

 






5 0
3 years ago
Other questions:
  • If you’re storing some personal information like Debit/Credit card numbers or Passwords etc, on different sites for running you’
    10·1 answer
  • Today, air travel allows large numbers of people to move quickly over long distances. Which of the following is a likely effect
    8·1 answer
  • Which of the given original work is protected by the copyright law
    9·1 answer
  • What cannot be performed using windows task manager
    10·1 answer
  • 3. Which of the following is called address operator?<br> a)*<br> b) &amp;<br> c).<br> d) %
    12·1 answer
  • Elsa wants to save her work at the office to be continued at home either on a pen drive or CD. Outline three reasons why she wil
    6·1 answer
  • How has music changed with the use of technology?
    14·1 answer
  • I'm getting pretty desperate plz help me, I'll give brainiest, and ill make a free question worth 100 points this is for coding
    10·1 answer
  • The condition known as __________ occurs when you try to store an integer that is bigger than the maximum allowed by the number
    5·1 answer
  • Due TODAY!!! Can someone please help me!!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!