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
netineya [11]
3 years ago
12

Given a sorted list of integers, output the middle integer. A negative number indicates the end of the input (the negative numbe

r is not a part of the sorted list). Assume the number of integers is always odd. Ex: If the input is:
Computers and Technology
1 answer:
masya89 [10]3 years ago
8 0

Answer:

The program in Python is as follows:

myList = []

num = int(input())

count = 0

while num>=0:

   myList.append(num)

   count+=1

   num = int(input())

myList.sort()

mid = int((count-1)/2)

print(myList[mid])

Explanation:

This initializes the list

myList = []

This gets the first input

num = int(input())

This initializes count to 0

count = 0

The following is repeated until the user inputs a negative number

while num>=0:

This appends the input number to the list

   myList.append(num)

This increments count by 1

   count+=1

This gets another input

   num = int(input())

This sorts the list

myList.sort()

Assume the number of inputs is odd, the middle element is calculated as

mid = int((count-1)/2)

This prints the middle element

print(myList[mid])

<em>From the complete question. the condition that ends the loop is a negative integer input</em>

You might be interested in
Averigua las diferentes intensidades, la potencia total y el gasto en € (de un mes de 30 días con el equipo conectado todo el ti
Naily [24]

<u>Explanation</u>:

<u>Here's what the question entails in clearer detail;</u>

Find out the different intensities, the total power and the cost in € (from a 30-day month with the equipment connected all the time) in the following case: Component Voltage (V) Power (P) CPU 0.95 V 27.97 W RAM 1,257 V 2.96 W Graphics Card 3.28 V 75.3 W HDD 5.02 V 19.3 W Fans 12.02 V 2.48 W Motherboard 3.41 V 18.3 W

7 0
3 years ago
Your new client's AdWords account has one campaign with one ad group that contains a list of hundreds of keywords. Which best pr
Degger [83]
<span>Create new ad groups with related keywords grouped together</span>
8 0
3 years ago
You manage a network that uses a single switch. All ports within your building connect through the single switch. In the lobby o
Karo-lina-s [1.5K]

Answer:

<u>VLANs</u>

Explanation:

Virtual LANs (VLANs) are a type of network connection or arrangement of network devices in the same broadcast domain. They are called Virtual LANs because they represent fractions or subgroups in the switch ports found in an Ethernet LAN.

Indeed, because of their topological arrangement, this reduces the security risk of unauthorized access to sensitive data or devices since the host can be placed on a different VLAN. Hence, in this scenario, using this network feature would allow visitors to plug into these ports to gain internet access, but they would not have access to any other devices on the private network.

5 0
3 years ago
Allowing every communication is a bad idea from a security standpoint as well as a productivity one.TrueFalse
s344n2d4d5 [400]

Answer:

The answer to this question is True.

Explanation:

If we allow every communication this will not be a great idea if we want better security and better productivity.

There will be a lot of spam communications so the productivity and the security will also degrade because of that.

So if we want better productivity and security we have to allow a certain number of connections.

Hence the answer to this question is True.

4 0
3 years ago
To rearrange the data on your hard disk so your computer can run more efficiently, you use ____.
Ratling [72]
A disk optimization program, but they're probably looking for defragmenting program.
5 0
3 years ago
Other questions:
  • Multiple users report that the network printer, which is connected through the print server, is not printing. Which of the follo
    12·1 answer
  • Write an application named EnterUppercaseLetters that asks the user to type an uppercase letter from the keyboard. If the charac
    5·1 answer
  • Enter a formula using a database function to calculate the total value in the Cost column for expenses that meet the criteria in
    12·1 answer
  • Text can be easily moved from one location to another using _____.
    15·1 answer
  • Which of the following extends a network over a large geographic area by connecting local area networks together?
    14·2 answers
  • True or false? Compared to verbal language a shot is like a word
    12·1 answer
  • Question # 2
    7·1 answer
  • Which of the following describes the line spacing feature? Select all that apply. adds space between words adds space between li
    8·1 answer
  • What is the alogarithm for solving the perimeter of a triangle
    11·1 answer
  • What are some examples of productions categorized as non-broadcast productions?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!