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
Which statement best describes multimedia
d1i1m1o1n [39]

Answer:

I couldn't find options to this question online but I will give you an explanation so you can choose the correct answer.

Explanation:

The term multimedia refers to something that uses multiple media simultaneously when transmitting information.

Examples of this can be:

  • photographs
  • sounds
  • text
  • video

Multimedia frames the objects and systems that use multiple physical or digital media to transmit content. It also refers to the media that store and disseminate these types of content.

6 0
3 years ago
If a person is proactive, they do NOT have to be defensive.<br> True<br> False
Thepotemich [5.8K]
The answer is true for this question
6 0
2 years ago
Read 2 more answers
What makes jambinai so unique (it’s for band)
Rus_ich [418]

Answer:

Jambinai combines Korean folk music instruments and rock music instrumentation, which creates a different music style.

7 0
2 years ago
A___________is a collection of computer software, typically malicious, designed to enable access to a computer or an area of its
Molodets [167]

Answer: rootkit

Explanation:

Hi, A rootkit is a collection of computer software, typically malicious, designed to enable access to a computer or an area of its software that is not otherwise allowed (for example, to an unauthorized user) and often masks its existence or the existence of other software.

A rootkit provides continued privileged access to a computer while hiding its presence. Because of this hiding characteristic it is very difficult to detect.

Once a rootkit has been installed, it allows someone to have total remote control of a computer and do things such as files executions and system changes.

4 0
3 years ago
Sam's take-home pay is $743. His deductions are $25 for OASDI, $5 for Medicare, and $27 for income tax. What is his gross pay? A
Katarina [22]

<u>Answer:</u>

A. $686.00

<u>Reasoning:</u>

25+5+27=57 So the total amount of the deductions is $57

Subtract 57 from 743

743 - 57 = 686

So he is left with 686

5 0
3 years ago
Other questions:
  • hona is buying a rug for her room. Store A has the rug for $45 with a 10% discount. Store B has the same rug for $46 and is offe
    5·1 answer
  • What feature new to Windows Server 2012 provides the ability to find identical sets of data on a SAN based storage array and red
    14·1 answer
  • In a typical e-mail address, what is the "host"? A. an account designated by a user name. B. the computer that houses an Interne
    7·1 answer
  • Which of the following is the best definition of being a “digital citizen”?
    6·2 answers
  • CHALLENGE 7.1.1: Initialize a list. ACTIVITY Initialize the list short.names with strings 'Gus', Bob, and 'Ann'. Sample output f
    9·1 answer
  • Joel has left his computer unattended while answering a phone call. A TV repairer in his house tries to surf through the applica
    13·1 answer
  • List three differences between word and excel
    8·1 answer
  • suppose as a head software engineer you assign the job of creating a class to a subordinate. You want to specify thirty-eight di
    11·1 answer
  • Explain the following buttons as used in emails:compose,inbox and Draft.<br>​
    10·1 answer
  • I'm showing my friends brainly. Answer with anything so they can see how fast I can get answers.
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!