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
Y_Kistochka [10]
3 years ago
5

Write a function findEvenQueue that returns the first even number in the Queue. The function looks at the value at the front of

the queue and checks if it’s even. If the value is even, then it returns that number. If the value is not even, then it removes that item from the queue and the process is repeated checking the front of the queue again. The function should return -1 if there are no even numbers. HINT: The program should make use of the peek method and the poll method of the queue.
Computers and Technology
1 answer:
Bumek [7]3 years ago
4 0

Answer:

Check the explanation

Explanation:

CODE:

static int findEvenQueue(Queue<Integer> numbers)

{

//loop runs till the queue has atleast one element

while(numbers.size() > 0)

{

//Checking the head of the queue whether it is even

int temp = numbers.peek();

if(temp % 2 == 0)

{

//if the head is even then return it

return temp;

}

else

{

//else remove the number at head

int removed = numbers.poll();

}

}

//if no even number present in the Queue then return -1

return -1;

}

You might be interested in
Name two driving factors in the development of computers.
sertanlavr [38]

The two driving factors in the development of computers are the  Skill set of the team. [If the team is well versed in a specific stack, then the performance will be good as compared to any other stack].

<h3>What re the matters?</h3>

There are some matters to consider. For business programs, I'd say gaming. A lot of what the common laptop makes use of for enterprise doesn't require that kind of electricity.

  1. The skill set of the team. [If the team is well versed in a specific stack, then the performance will be good as compared to any other stack]
  2. Process familiarity. [If dev team knows the stack but the deployment/service team is new, then you may run into deployment and maintenance issues.]

Read more about the computers:

brainly.com/question/24540334

#SPJ1

8 0
2 years ago
When in global configuration mode, which steps are necessary to edit an ip address on an Ethernet interface?
katrin2010 [14]

Answer:

I. You should enter interface configuration mode.

II. Configure the IP address and subnet mask.

Explanation:

A node refers to the physical device that make up a network and are capable of sending, receiving, creating and storing data in communication.

Some examples of network nodes are modem, hubs, computer, switches, phone and printers.

In Computer networking, network devices such as routers and switches are usually configured (programmed) through the use of specific network commands commonly referred to as configs e.g show int description, config terminal (config t), show IP address, etc.

In Cisco devices, there are five (5) main types of command modes;

1. Sub-interface configuration mode.

2. Interface configuration mode.

3. Line configuration mode.

4. Router configuration method.

5. Global configuration mode.

Global configuration mode is a configuration mode that avail network engineers and end users with the ability to modify or edit the running (global) system configuration of a networking device. Thus, any change effected at the global configuration mode will affect the network device as a whole.

In global configuration mode, the steps which are necessary to edit an ip address on an Ethernet interface include;

I. You should enter interface configuration mode using the "configure terminal" command.

II. Configure the IP address and subnet mask.

See an example below;

"Router(config-if)# IP address 192.168.1.2 255.255.255.0"

4 0
3 years ago
Your organization will be handling market trades. You will be required to verify the identify of each customer who is executing
zmey [24]

Answer:

The correct answer for the following question will be Digital certificate.

Explanation:

An electronic "password" that allows an organization or person to exchange information (data) with security using the public key infrastructure (PKI) over the internet called as Digital certificate. And is also known as Public key certificate and identity certificate.

Digital certificate contains the following things :

  • Copy of certificate holder public key.
  • Name of certificate holder.
  • Serial number which is used to uniquely identify a certificate.
  • Expiration dates.
  • Digital signature of certificates.

What security provided :

  • Identification/Authentication.
  • Access Control.
  • Non-Repudiation.
  • Integrity.

 

5 0
3 years ago
Who are the four main antagonists in fnaf 1
ikadub [295]

Answer:

lol it's foxy freddy bonnie and chica

5 0
3 years ago
Read 2 more answers
What automatically created subdomain holds all the SRV records for Microsoft-hosted services, such as the global catalog, LDAP,
nevsk [136]

Answer:

The correct answer to the following question will be "_msdcs".

Explanation:

Msdcs directory known as Microsoft Domain Controller Catalog requires SRV documents that are used to identify domain controller for certain operations.

  • It automatically generated subdomain keeps all Microsoft-hosted resources SRV data, so it's the correct answer.
  • It includes common SRV documents, documents of LDAP, documents of Kpass, CNAME, etc.
7 0
4 years ago
Other questions:
  • What types of data are commonly entered into a cell ?
    7·2 answers
  • Under the class system, how many host ids were available in a class b network?
    7·1 answer
  • The presentation ____ determines the formatting characteristics of fonts and colors.
    11·2 answers
  • Chevening is looking for individuals with strong professional relationship building skills, who will engage with the Chevening c
    15·1 answer
  • Refer to the exhibit. If a hacker on the outside network sends an IP packet with source address 172.30.1.50, destination address
    11·1 answer
  • Which feature of a website takes you to a different part of the website or a totally different website when you click on it?
    12·2 answers
  • Qué es un bloque de programación?
    5·1 answer
  • What line of code makes the character pointer studentPointer point to the character variable userStudent?char userStudent = 'S';
    5·1 answer
  • Do you all like IXL?
    8·1 answer
  • To improve readability and maintainability, you should declare ________ instead of using literal values such as 3.14159.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!