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 following is a true example of a computer: A. Toyota Camry
fomenos

Answer:

D

Explanation:

They all fit the definition of a computer

7 0
3 years ago
A user calls your help desk and says that he is trying to configure his Word document so that the text within his paragraphs is
katrin [286]

Answer:

The best answer would be

Explanation:

To access this command ...

Select the Format tab - Properties - Paragraph properties - Bleeds and spaces

7 0
4 years ago
FREE BRAINLIEST!!!
Nastasia [14]

Answer:

B

Explanation:

4 0
3 years ago
Read 2 more answers
Is C++ a high-level or low-level programming language? What about HTML?
N76 [4]

Answer:

c++ is low level

html high level

Explanation:

6 0
3 years ago
A troubleshooting strategy that removes components from a system in order to get back to a basic configuration is called module
Semmy [17]

Answer:

B. False.

Explanation:

Troubleshooting strategy is a technique used to discover the cause of defeat in a system. The technician must learn to improvise with these strategies to solve a system problems.

Module replacement is a type of troubleshooting strategy that replaces a component with unknown status with another component with good status to determine the cause of the problem.

Removing a component from a system to get back to its basic configuration helps to eliminate factors that may make a computer problem difficult to solve.

3 0
3 years ago
Other questions:
  • The item in this illustration that is highlighted is the _____. quick access tool bar view buttons status bar zoom control
    10·2 answers
  • The lightbulb transfers electricity energy into light what is one type of energy that is also generated that is not a desired af
    14·1 answer
  • Which of the following is a popular open source intrusion detection system that runs on SmoothWall?? Synchronous Dynamic Random
    6·1 answer
  • You manage a small LAN for a branch office. The branch office has three file servers and few client workstations. You want to us
    14·1 answer
  • What is the difference between word processing software and email?
    12·2 answers
  • HELP PLZZ FAST!!!!!
    10·2 answers
  • What is the function of the NOS? Select all that apply.
    5·2 answers
  • Can someone please help me...pls.. how do u delete an account on this app(brainly)..pls help fast​
    7·2 answers
  • A(n) ____________________ key is a key that is not reused, but rather is only used once, thus improving security by reducing the
    5·1 answer
  • Which two keys are commonly used to move or insert data?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!