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
The global network that links millions of computers is the
vitfil [10]
Your answer would be C. Internet since we all use the internet everyday to communicate through all over the world. We can currently communicate to the other side of the world with little to no effort now, almost 10 years ago it would of been very difficult.
6 0
2 years ago
Read 2 more answers
What is the viewport?
Shtirlitz [24]
C. The viewing area of a web browser.

The viewport is the user's visible area of a web page.
5 0
2 years ago
An archive of files that usually contain scripts that install the software contents to the correct location on the system is ref
Anika [276]

Answer:

Option 3 is the correct answer for the above question.

Explanation:

  • A tarball is a software which is used to encrypt the other software or hide the other software and make it small. It again makes the original software program from the encrypted ones.
  • It is used to make the file sort and can use for the transfer which takes some amount of memory.
  • The above question asked about that technology which is used to make encrypted software from the original software and use it with the help of some script. Then the answer is tarball which is referred to from option 3. Hence Option 3 is the correct answer for the above question while the other is not because--
  • Option 1 states about the package manager which is used to manage the library only.
  • Option 2 states about the DBMS which is used to manage the database.
  • Option 4 states about the router which is used for the internet.

8 0
3 years ago
A measure of the twisting or rotational force that an engine can produce is called
Snowcat [4.5K]
The correct answer is torque.

Torque
A twisting force that tends to cause rotation, commonly used term among mechanics and engineers.
7 0
2 years ago
) What is the ""Phantom Inspector""? (
matrenka [14]

Answer:

 Phantom inspection is the process of finding various defects in the documents according to the . Basically, it is a group of meeting that usually provide the synergy effects and the maximum defects can easily be detected. This entire process is known as phantom inspector.  

It is also made some assumptions regarding the inspection that is made by one and more than one individual.

This process are usually done by inspecting the each operation output with the given output requirements.

4 0
2 years ago
Other questions:
  • Discuss why mtv initially had a difficulty securing enough ads
    10·1 answer
  • The ability to anticipate and determine upcoming driving hazards and conditions are adversely affected
    14·1 answer
  • How do you put a picture when you ask a question?
    6·2 answers
  • Java supports ________; collections of related methods that typically enable you to tell objects what to do, but not how to do i
    12·1 answer
  • You are configuring two PCs for your network, PC-A is given an IP address of 192.168.1.18 and PC-B is given an IP address of 192
    15·1 answer
  • PLZZZ HELP!!! I’ll give brainliest
    12·1 answer
  • Word templates include pre-made flyers which may be edited and saved only if permission is obtained from the Microsoft Office te
    11·1 answer
  • Algorithm of how to calculate the area of a square.
    12·2 answers
  • Political parties to address the interest of civil society<br>​
    7·1 answer
  • 3.5 code practice question 1
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!