Given a sorted list of integers, output the middle integer. a negative number indicates the end of the input (the negative number is not a part of the sorted list). assume the number of integers is always odd.
ex: if the input is: 2 3 4 8 11 -1
the output is:
middle item: 4
the maximum number of inputs for any test case should not exceed 9. if exceeded, output "too many numbers". hint: first read the data into a vector. then, based on the number of items, find the middle item. 276452.1593070
(must include vector library to use vectors)

Answers

Answer 1

inputs=[]

num_inputs=int(input())

if(num_inputs>9):

   print("Too many inputs")

else:

   print(num_inputs)

   for i in range(num_inputs):

       inputs.append(input())

   print(inputs)

   middle_position=int(num_inputs/2)

   print(inputs[middle_position])


Related Questions

Carrie needs to keep a budget for her department. Each employee in her department sends her travel expenses. In cell, C2, C3, C4, and C5, she enters the total of each employee’s expenses. In cell B1, she enters the original amount of money the department was allotted for spending. What formula should she use to calculate the amount of money the department currently has?

=B1 -(C2+C3+C4+C5)
=B1-C2+ B1-C3+B1-C4+B1-C5
= (C2+C3+C4+C5)-B1
=(B1+C2+C3+C4+C5)

Answers

Answer:

(C2+C3+C4+C5)-B1

Explanation:

Answer:

=(C2+C3+C4+C5)/4

Explanation:

add all numbers together then div. by the total amount of numbers is how you get the average.

What could cause an external drive, like a usb flash drive, to not be recognized when plugged into a computer?.

Answers

The reasons for a flash drive being not recognized when plugged in are the drive can be corrupt or broken, the port of the computer may be broken.

What is a USB flash drive?

A USB flash drive is a drive is a small device that connect devices with computer or insert data to the computer.

A USB have capacity to hold data within, and the data can be transported to anywhere.

Thus, the reasons for a flash drive being not recognized when plugged in are the drive can be corrupt or broken, the port of the computer may be broken.

Learn more about USB flash drive

https://brainly.com/question/14144068

#SPJ1

What is a border line

Answers

Answer:

a border line is what separates to places from one another like if i were to go to mexico i would have to cross the border

Explanation:

Depends on context.

- Could be a line marking a border

- Barely acceptable; borderline

Example:

She was a borderline candidate.  

This means that she barely made it as a candidate role.

What initialization vector (IV) do most weak implementations of the Wireless Equivalency Protocol (WEP) use

Answers

24 bits is an initialization vector (IV) which is used by most weak implementations of the Wireless Equivalency Protocol (WEP).

What is Wireless Equivalency Protocol (WEP)?

Wireless Equivalency Protocol (WEP) can be defined as a standard wireless protocol that is designed and developed to provide a significant level of security and privacy on 802.11b wireless local area network (WLAN).

According to the IEEE Wireless Fidelity (Wi-Fi) standard, 24 bits is an initialization vector (IV) which is used by most weak implementations of the Wireless Equivalency Protocol (WEP).

Read more on Wireless Equivalency Protocol here: https://brainly.com/question/13697151

#SPJ1

An employee at a large global firm is sending a document with sensitive information to a co-worker in another country. how should the contents of the document be protected?

Answers

The employee at a large global firm which is sending a document with sensitive information to a co-worker in another country can document the data with end-to-end encryption.

How document be protected?

There are many ways a computer file can be protected. The ways to protect the document are,

Using the cloud based secure file sharing sites.The protected view can be used to secure the contents of the document sending to another country.When the file is end-to-end encrypted between the employee and co worker, then no one can be seen the file in between.

Thus, the employee at a large global firm which is sending a document with sensitive information to a co-worker in another country can document the data end-to-end encryption.

Learn more about the data protection here;

https://brainly.com/question/4219149

#SPJ2

At Universal Containers, the sales managers would like Opportunities that have NOT been updated in the past 30 days to automatically be flagged. How should a System Administrator implement this requirement

Answers

The System Administrator implement and Create a formula field to calculate the time since last update and display an image of a red flag if it meets the defined criteria.

What is a  Formula field?

This is known to be a read-only fields that often calculate a value through the use of other fields or a given  formula.

Note that The System Administrator implement his requirement and Create a formula field to calculate the time since last update and display an image of a red flag if it meets the defined criteria.

Learn more about System Administrator  from

https://brainly.com/question/27129590

#SPJ1

When you collaborate or meet with a person or group online, it is called
1. cloud computing
2. social networking
3. text messaging
4.web conferencing

Answers

When you collaborate or meet with a person or group online, it is called  social networking.

What is social networking?

The term  social networking is known to be the act of meeting people online, interacting with them and even making friendship with them.

Therefore, When you collaborate or meet with a person or group online, it is called  social networking.

Learn more about  social networking from

https://brainly.com/question/1027666

#SPJ1

Help me with this question asap please :)

Answers

Answer:

I think it's sequence as there is a pattern of connection in the words

Given a sorted list of integers, output the middle integer. assume the number of integers is always odd.
ex: if the input is:
2 3 4 8 11 -1
(a negative indicates the end), the output is:
4
the maximum number of inputs for any test case should not exceed 9. if exceeded, output "too many inputs".
hint: first read the data into a vector. then, based on the number of items, find the middle item.
#include
#include // must include vector library to use vectors
using namespace std;
int main() {
/* type your code here. */
return 0;
}

Answers

integer userInput

integer i

integer mid

integer array(20) number

userInput = 1

for i = 0; userInput >= 0; i = i + 1

  if number[i] > -1

     userInput = Get next input

     number[i] = userInput

i = i - 1

mid = i / 2

if i > 9

  Put "Too many inputs" to output

elseif i % 2 == 0

  Put number[mid - 1] to output

else

  Put number[mid] to output

CODEHS: WHY is it important to know the difference between div and span?

Answers

Span and div are both generic HTML elements that group together related parts of a web page. However, they serve different functions. A div element is used for block-level organization and styling of page elements, whereas a span element is used for inline organization and styling.

what are trends in GPS ? ​

Answers

Answer:

New Trends in GPS & Telematics in 2021 and Beyond - Rewire Security. Real-time location tracking systems for cars, vans, motorcycles, lorries, wired or plug & play options—battery-powered GPS tracking systems with magnets attached to flat metal surfaces such as containers.

Explanation:

Stories used to be told only by:

OA. digitally recording them.

OB. saying them aloud.

OC. writing them down.

OD. drawing them on paper.

Answers

Answer:

OB. saying them aloud.

Explanation:

In the olden days, materials like recording devices, pens or paper weren't invented, so people had to know stories by heart.

Which automatic startup option should you choose when windows' startup fails immediately after installing a new driver but before you have logged on again

Answers

Answer:

last known good configuration

Explanation:

If you're having difficulties starting Windows, the Last Known Good Configuration, or LKGC for short, is a technique to get it started. It loads the drivers and registry data from the last time you began and shut down your computer successfully.

Complete the sentences.
The ACCUPLACER exam is a diagnostic test that evaluates the students’ progress in a specific academic field. It is divided into sections that assess reading, writing, and mathematics skills. The
section tests students’ ability to solve problems related to algebra, trigonometry, and geometry. The
section tests how well the students can write. The
section tests the students’ knowledge about sentence structure.

Answers

Answer:

fiances

Explanations it just  is

you want to be able to restrict values allowed in a cell and need to create a drop-down list of values from which users can choose. which feature should you use?

Answers

The  feature to restrict values allowed in a cell and need to create a drop-down list of values from which users can choose in the above scenario is data validation.

What is data validation?

Data validation is a term that connote the act of monitoring the truthfulness and quality of source data before one can make use of it, importing or even  process data with it.

Note that The  feature to restrict values allowed in a cell and need to create a drop-down list of values from which users can choose in the above scenario is data validation as it ensure that users can make their own choice.

Learn more about data validation from

https://brainly.com/question/27138101

#SPJ1

10.13 lab 10c: output range with increment of 5 write a program whose input is two integers. output the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. you may prompt for the two integers as you wish; the prompt will not be included in the grading. ex: if the input is:

Answers

he program gives an output in increment of 5, if the first inputted integer is less than the second. The program written in python 3 goes thus

Enumerate at least 5 furnitures you would add to your house which would be practical and energy-saving.

Answers

Answer:1. Advanced house framing

Advanced house framing, also known as optimum value engineering, is a specific framing technique wherein a house is constructed using less lumber and waste. Advanced house framing saves energy by using less wood and more insulation. According to the U.S. Department of Energy, using advanced framing can lower material costs by $500 to $1,000 for a 1,200- to 2,400-square-foot house. It can also cut labor costs by 3-5% and annual heating and cooling costs by up to 5%.

2. Cool roofs

Cool roofs are designed to reflect sunlight and lower roofing temperatures. Cool roofs are made from a type of reflective material within roofing materials such as tiles, shingles, paint or other substances. This energy-saving technique is ideal for houses in warm climates where air conditioning costs are high all year around.

3. The right exterior doors

Choosing the right exterior door for a home should be a carefully thought-out decision. When you choose a door, you should first consider the doors' energy-performance ratings. This score lets you know how well each door does in preserving the energy in your home by trapping heat or cool air inside. Using this score to help you find the ideal door will also help you narrow down your selection and find an exterior door that best matches your taste, needs and wants.

4. Skylights

Skylights are often a feature that enters homeowners' mind when they think of improving their homes' energy efficiency. Skylights have many benefits, which makes them ideal for any home. Skylights improve houses' heating, lighting and ventilation. It is important to note that if you are considering placing skylights in your home, the U.S. Department of Energy recommends they be no larger than 5% of the floor area in rooms with several windows, and 15% of the floor area in rooms with minimal windows.

5. Window treatments

Boring curtains do more than drive your spouse crazy; they can actually help reduce energy costs in your home. By being specific in your choice of window treatments, you can reduce heat loss or keep cool air inside your home. Many factors determine window treatments' energy efficiency. For example, the type of material and color of the treatment are significant, along with how it opens and closes.

Explanation:

when you start a new, blank document, you usually end up changing the font to arial 11.5 point. how can you make these settings the default for this and all future new documents?

Answers

The fonts setting can be change to default by opening the format menu, after that click Font, and then click the Font tab. Make the needed changes that you want, and then click Default.

What is font?

A font is a set of printable or displayable text character s in a specific style and size.

These are the complete set of character like numbers, letters, and symbols/icon within a typeface, which is the design of the characters.

Hence, we can easily change the fonts setting to default.

Learn more about fonts here,

https://brainly.com/question/14934409

#SPJ1

Which of these would you least expect to find at an fbla-pbl meeting?

planning a community service project

role-playing to develop leadership skills

students working on iste certification

working with local business leaders

Answers

role-playing to develop leadership skills

What are the real-life applications of coding? any smart person who can give this ans

Answers

Answer:

Coding is used for a ton of different things. It can be used to create websites, video games, and apps. It is also an essential part of artificial intelligence and machine learning. Coding is a way to create computer programs that have a sequence of instructions for the computer to execute.

Explanation:

When should a user consider restoring the operating system.

Answers

A user can consider restoring the operating system if the programs or apps do not start properly or when they are hanging/freezing.

What is an operating system?

This is known to be a software that aids a computer's basic functions, such as working on tasks and others.

Note that A user can consider restoring the operating system if the programs or apps do not start properly or when they are hanging/freezing.

Learn more about  operating system from

https://brainly.com/question/22811693

#SPJ1

John is using a spreadsheet program. He needs to select two cells that are non-adjacent to one another. He is currently holding down the "Shift" key while clicking on the two cells. Interpret John's mistake.

John is using a right click when he should be using a left click

John should be holding the "Alt" key instead of the "Shift" key

John is not making any mistakes

John should be holding the "Ctrl" key instead of the "Shift" key

Answers

Answer:

John should be holding down the "Ctrl" key instead of the "Shift" key.

Explanation:

"Ctrl" key must be held down when selecting multiple cells, not "Shift" key.

Hope this helps!

Answer:

John should be holding the "Ctrl" key instead of the "Shift" key

Explanation:

Android os is developed by​

Answers

Answer:

It is developed by G oogle

Explanation:

Android os is developed by G oogle. It launched in 2008.

If you are interested in an occupation as an operating system administrator or software engineer, you also may benefit from certifications in networking, hardware, and the Internet. Group of answer choices True False

Answers

True

Explanation:

because in that field there are many things you need to learn and that includes mostly all of them, as an Operating system administrator you most likely need to know things revolving around the system such as the compatibility with the Hardware. And as an Software engineer you NEED to know if your software is even compatible with the new technologys or if there are any problems, the same goes to networking

feel free to correct me

You have purchased a new LED monitor for your computer. On the back of the monitor, you see the following port (pictured below). Which type of cable should you use to connect the monitor to your computer

Answers

There's no picture however the cable might be a HDMI since it's commonly used

You are responsible for managing an internal FTP server. A user reports that files available on the server yesterday are no longer available. Where can you look to determine what happened to the missing files

Answers

To determine what happened to the missing files are file Transfer Protocol (FTP) access logs list file activity on FTP servers, including file deletions or renames.

What is a FTP server?

FTP is a File transfer protocol. It is a transfer of files from the client and the server on a computer network.

It is a basic thing in transferring or sharing files between two computer networks.

Thus, To determine what happened to the missing files are file Transfer Protocol (FTP) access logs list file activity on FTP servers, including file deletions or renames.

Learn more about FTP server

https://brainly.com/question/27610307

#SPJ1

Which best describes how information is sent on the internet?

Answers

Answer:

a. The information is first sent via a Broadband for efficient transmission, and if not successful, only then it is resent via a Baseband that exists as a backup network as packets b. The message is first broken down into small packets before being sent, then they are

Explanation:

Compare and contrast sources and types of credit, including costs and benefits of installment
credit, collateralized loans versus unsecured credit, credit cards, mortgages, auto loans, and
student loans.

Answers

Answer:

loan your mom

Explanation:

what word makes this inappropriate????

Answers

Hm. Maybe it’s a glitch? Maybe it thought of something dirty? :/

If “A” represents in binary 10011001, what will be the value of word “CAB”?

Answers

Answer:

01000011 01000001 01000010

Explanation:

You can convert to and from binary and the base-10 system typically used by humans. You can also convert to and from binary and hexadecimal where you need four digits of binary to represent one digit of hex. Converting to and from binary and octal is another possibility. It takes three binary digits to represent an octal digit. Binary 000 is octal digit 0.

Other Questions
2. Define chain reaction. A hot air balloon holds 1,592 cubic meters of helium. the density of helium is 0.1785 kilograms per cubic meter. how many kilograms of helium does the balloon contain, rounded to the nearest tenth of a kilogram? 432.3 kg 284.2 kg 2,043.7 kg 5,435.3 kg PLEAAAAAAAAAAAASEEEEEEEEEEEEE HELP!!!!!!!!! | In your own words, describe when you should use area, and when you should use volume in calculating the amount of space an object occupies. Find the length of arc XPY. Leave your answer in terms of pi. I need help asap please According to solomon asch's and other research results concerning conformity, all of the following increases an individual's tendency to conform except __________. please select the best answer from the choices provided if group agreement is unanimous if culture encourages accordance with social standards if one is feeling secure and competent if the group has high status What form of government does south africa currently have?. How do you convert fractions into decimals?And the other way around? What is the surface area of the triangular prism shown? Simplify the fraction Which person would have the highest social status in the Inca Empire? A. A farmerB. A soldier C. A government official D. A craftsperson Suppose there is a simple index of two stocks, stock A and stock B. Stock A opens on Monday with 10,000 shares at $5.50 per share. Stock B opens on Monday with 8000 shares at $6.25 per share. Stock A opens on Tuesday at $5.80 per share, and stock B opens on Tuesday at $6.65 per share. Both stocks have the same number of shares that they opened with on Monday. What is the rate of change of this simple index over 1 day? A. 5.6% B. 5.9% C. -5.6% D. -5.9% Aline has a slope of 6 and includes the points (-9, 0) and (-8, a). What is the value of a?SubmitPlease help 4. Make a table and graph the function. (1 point)y = 4x + 2 Simplify 85.84O A. 820O B. 169O C. 89O D. 649 Simplify this expression (15+8d)(-5)-24d+dSolve step by step Mr. Ramirez demonstrates that objects can exert forces on each other even when the objectsare not touching. He removes two long pleces of clear plastic tape from a tape dispenser. Heholds a piece of tape in each hand so that they are hanging down. As he moves his hands closer together, the pieces of tape repel each other. His students then plan an investigation to study the forces exerted by the pieces of tape. a. Identify two factors that may affect the forces exerted by the pieces of tape. Explain yourreasoning. b. Describe how the effect of one of the factors you identified in part (a) could be tested. Be sure to include a description of how the effect would be measured and how the collected data would be analyzed. Question 2Please read the following sentence.Once Jane lifted her pen and made a start, writing the essay became easy.If we change the start of the sentence to:Writing the essay became easy..........What will the ending be? A: after starting.B: after lifting her pen.C: once Jane lifted her pen and made a start. D: once she lifted her pen and made a start. E: None of these.i PLSSS HELP IF YOU TURLY KNOW THISS Write a story with at least 12 words: vast, mischievous, innocent, magnificent, grasp, snatch, wasp, mole, tortoise, boa constrictor, groove, wrist, stall, veil, car boot, lawnmower, gnome, pursuit, stung.