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

Answer 1

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


Related Questions

A family just changed to a different mobile phone and data service provider. They now need take some time to transfer their content to new phones and learn the features of the new service. This is an example of a:

Answers

The above scenario is an example of  switching cost customers incur changing to a new supplier.

What id Switching costs?

This is known to be the the costs that a consumer gets or has due to the effect of changing brands, or products.

Note that the above is an example of  switching cost customers incur changing to a new supplier as they are said to be psychological, effort-based, and needs time.

Learn more about mobile phone from

https://brainly.com/question/917245

#SPJ1

An administrator at cloud kicks wants to deactivate a user who has left the company. what are two reasons that would prevent a user from being deactivated

Answers

A reason that would prevent a user from being deactivated by an administrator is assigning the user in a workflow email alert.

The role of an administrator in a cloud network.

In Cloud computing, an administrator has the privilege and express authority to either activate, deactivate or suspend the account of an end user that is registered on his or her Cloud services platform.

However, there are two (2) reasons that would prevent an administrator from deactivating an end user and these include the following:

The end user is located in a Cloud's Custom hierarchy field.The end user has been assigned in a workflow email alert.

Read more on cloud computing here: https://brainly.com/question/19057393

#SPJ1

using one sentence or phrase, how does each web version ( web 1.0, web 2.0, web 3.0 ) differ from one another?​

Answers

Web 1.0 connected people to information and Web 2.0 connected people to each other, both iterations were built on technology and products governed by centralized organizations and corporations. Web 3.0 connects information, people, and property, essentially digitizing trust through decentralized blockchain technology.

One sentence? Here goes:

Web 3.0 is the latest iteration of the Internet, designed learning the lessons and incorporating the features from 1.0 and 2.0, into a decentralized trust network.


Elaine wants to create a program based on the following algorithm. What data types will she use for the variables?
1. Start.
2. Read number x from the user.
3. Read list of ages age from the user.
4. Display the age at the x position in the list age].
5. Stop.
to store variable x (for example 1, 4, 7), and she can use
She can use a[n)
example 24, 53, 21).
to store list age] (for

Answers

The data types that she  will use for the variables are:

Numeric Data TypeStrings

What are Data Types?

In Programming, there is the use of a lot of numbers that is made up of different data types.

Note that A data type helps one to know what type of value an object can have and the operations that needs to be performed and as such, The data types that she  will use for the variables are:

Numeric Data TypeStrings

Learn more about  data types from

https://brainly.com/question/179886

#SPJ1

What command will provide information about the dynamic routing protocols on your Cisco router and their configurations

Answers

you use the show ip protocols command.

Functions in Excel are grouped for easy reference. Locate the Insert Function button (Fx button) to bring up the Insert Function dialog box. How many different ways exist to look for a function

Answers

Following are the different ways that exist to look for a function,

Option 1: Insert function button (Fx button) on the Formulas ribbon.

Option 2 : More Functions from arrow near Auto sum icon on Home ribbon.

Option 3: Function Library on the Formulas ribbon.

Option 4: Shift + F3

Option 5: Enter = followed by first letter of the function.

What it does -

This function returns the number of whole working days between two dates with custom weekend parameters.

What it needs -

1. Start date, End date, Weekend (Optional), Holidays (Optional)

2. If start date later than end date, then value will be negative.

3. Enter date in specified format.

What is Excel?

Excel uses a large collection of cells formatted to organize and manipulate data and solve mathematical functions.

Learn more about excel here,

https://brainly.com/question/21382498

#SPJ1

In deviation detection, new data is compared with a set of data called (blank) data. before data mining, it is important to remove (blank) data from databases.

Answers

In deviation detection, Predictive  analysis is used to know future results using past data while Descriptive analysis is used to see or find patterns in existing data.

What is deviation detection?

This is known to be a  Data mining work  where one build a model that tells about the most vital changes in the data from previously used or normative values.

Therefore, In deviation detection, Predictive  analysis is used to know future results using past data while Descriptive analysis is used to see or find patterns in existing data.

Learn more about deviation detection from

https://brainly.com/question/22257149

#SPJ1

Answer: in deviation detection, new data is compared with a set of data called training data. before data mining, it is important to remove noisy data from databases.

Explanation: plato

A related database stores data in the form of______

Answers

Answer:

Lists.

Explanation:

A relational database stores data in the form of lists.

You are writing code for a custom mobile device app, and for security reasons, you want to prevent tampering and the ability of others to read the code. Which technique will accomplish the requirement

Answers

Obfuscating programming code, often called code camouflaging, is done using a software development plug-in. The result is an unreadable variation of the original readable text.

Type the correct answer in the box. Spell all words correctly.

Cathy wants to set up a new web server and is busy collecting needed hardware. She has heard of friends facing issues online due to power outages. Which hardware device does Cathy need to ensure data safety in case of a power failure?

Cathy needs a[n) _______ device to ensure data safety in case of a power failure.

Answers

Answer:

surge protector

Explanation:

An uninterruptible power supply can save data during an outage, and a surge protector can prevent damage from a surge. Surge protectors absorb or ground overvoltage from spikes. Each time a surge protector does its job, resulting damage can reduce effectiveness for the next surge.

Answer:

a UPS

Explanation:

A UPS is a "uninterruptible power supply" that allows a computer to keep running for at least a short time when incoming power is interrupted.

What is a table in Excel?

a worksheet that has conditional formatting rules applied to it
a group of cells with content created by the AutoFill feature
a group of related data without any spaces between cells
the header and footer of an Excel worksheet

Answers

Answer:

c

Explanation:

i got it wrong twice so it gave me the correct answer.

HELP
When differentiating data, the WHAT of the data is:

Answers

Answer:

a source and a target.

Explanation:

In computer science and information theory, data differencing or differential compression is producing a technical description of the difference between two sets of data – a source and a target.

The two 1s in binary number ‘0100010’ do not have the same value. Explain why?

Answers

Answer:

The first 1 on the left is 32 and the 1 on the right is 2. Hence this 8 digits binary number represents 32 + 2 which is the decimal number 34

Explanation:

each 1 represents the number 2 powered by a different number, so starting at the further right, the first number with value 0 is representing 2^0 , the next on the left which is value 1 is representing 2^1 which is 2 and so on. So the other 1 further on the left will be 2^5  which is 32.

Every other digit that is zero is not taking any value, but if they were, they would all be taking values from 2^0 to 2^7 Take a look below:

0  0  1  0  0  0  1  0

      32             2

Match the script file extension to the description. - .bat - .ps1 - .vbs - .sh - .py - .js a. Windows PowerShell script file b. Unix or Linux shell script file c. Windows batch file

Answers

Answer:

.bat = windows batch file

.ps1 = windows powershell file

.vbs = virtual basic script

.sh = unix or linux shell script file

.py = python file

.js = javascript file

Hello! I am having trouble with this code and I am trying to find out the error. (html5 by the way.)

body {
background-color: lightblue;
color: deeppink;
}

h1 {
width: 100%;
}

{
float: right;
width: 200px;
margin: 10px;
border-radius: 20px;
}

p {
text-align: left;
font-family: fantasy;
font-size: 14px;
}

Answers

Explanation:

On line 10 you wrote:

{

float: right;

width: 200px;

margin: 10px;

border-radius: 20px;

}

This is the origin of your error. You have not declared any selector for the properties. Remember CSS rules take the following form:

selector {

   property: value;

}

Identifying correction services tasks
what are some tasks commonly performed in correction services jobs? check all that apply.
interviewing law offenders
using weapons, handcuffs, and other tools to control prisoners
transporting people who are sick or injured to hospitals
maintaining order and security in a courtroom
searching prisoners and their belongings
o providing legal advice to inmates
o guarding and counting inmates

Answers

The correction services tasks are:

The using of weapons, handcuffs, and other tools to control prisonersTransporting people who are sick or injured to hospitalsGuarding and counting inmates.

What is the role of the corrections?

Corrections is known to be  the aspect of  criminal justice system that helps to handle individuals who have been found to have done or committed  a crime.

Note therefore, that the correction services tasks are:

The using of weapons, handcuffs, and other tools to control prisonersTransporting people who are sick or injured to hospitalsGuarding and counting inmates.

Learn more about correction services from

https://brainly.com/question/6705028

#SPJ1

Answer:

a.b.e.g

Explanation:

Car.py The Car.py file will contain the definition of a Car class. The Car class will hold information about the cars (make, model, year, and price). We will define the Car attributes as follows: make - string value representing the brand of the car (eg. Nissan, Tesla, Toyota, Ferrari). Your program must store this attribute in uppercase characters model - string value representing the model of the car (eg. Electra, Model3, Prius, Portofino). Your program must store this attribute in uppercase characters year - integer value representing the year of the car (eg. 2010, 2000, 1963) price - integer value representing the price value of the car (eg. 20000, 30000, 25000) You will write a constructor that allows the user to construct a Car object by passing in values for the make, model, year, and price. __init__(self, make, model, year, price) In addition to the constructor

Answers

The Car.py program is an illustration of constructors and classes in Python

Constructors are used to create the instant of objects

The program in Python

The program written in Python is as follows:

class Car:

make = ""

model = ""

year = 0

price = 0

def  __init__(self, make, model, year, price):

 self.make = make.upper()

 self.model = model.upper()

 self.year = year

 self.price = price

def display(self):

 print("Make = " + str(self.make.upper()))

 print("Model = " + str(self.model.upper()))

 print("Year = " + str(self.year))

 print("Price = " + str(self.price))

Read more about Python programs at:

https://brainly.com/question/26497128

#SPJ1

Which sentence will be parsed by the following CFG?
s a NOUN VERB
ОА.
cats walk
ОВ.
a cat walks
Ос.
A cat walks
OD. cat walking

Answers

I think that cats and walk are the right answer because it is the one that makes the most sense to put hope it helps

Consider sending a stream of packets from host a to host b using ipsec. typically, a new sa will be established for each packet sent in the stream. true or false

Answers

Consider sending a stream of packets from Host A to Host B using Ipsec. Typically, a new SA will be established for each packet sent in the stream. True or False? Tweet Answer FALSE. REASON: Ipsec SA is first connect with Host A and Host B. So, all packets in the stream use the new SA.

In what year was the earliest documented use of the word computer?.

Answers

Answer:

1613

Explanation:

referring to a person who carried out calculations, or computations, and the word continued to be used in that sense until the middle of the 20th century. This means that at first, "a computer" was a "person".

in multi-channel funnel reports, how are default conversions credited?

Answers

The Multi-Channel Funnels reports are generated from conversion paths, the sequences of interactions (i.e., clicks/referrals from channels) that led up to each conversion and transaction. In the reports, channels are credited according to the roles they play in conversions—how often they assisted and/or completed sales and conversions.

what would be the effect of an addition or a deletion of one of the bases in a codon?

Answers

Answer: When a nucleotide is wrongly inserted or deleted from a codon, the affects can be drastic. Called a frameshift mutation, an insertion or deletion can affect every codon in a particular genetic sequence by throwing the entire three by three codon structure out of whack.

Explanation:

When sending a group email, how do you ensure that one or several recipients cannot see the names of other recipients?.

Answers

To ensure that one or several recipients cannot see the names of other recipients make use of the Bcc field,.

What is the email about?

To send emails to a groups one can make use of the Cc field. This is where a person input all of the addresses there, and then separated them by commas.

Note that to hide addresses, make use of the Bcc field, as no body will be able to see the addresses added in this field.

Learn more about emails from

https://brainly.com/question/24688558

#SPJ1

What is one of the downsides of computer technology's role in creating images?

OA. Quality sometimes loses out to quantity.

OB. Information can be shared.

OC. Pictures can be preserved.

D. Images cannot be changed.

Answers

Answer:

A. Quality sometimes loses out to quantity.

Explanation:

What happens is that now quantity surpasses quality. Many people want to post a variety of pics or be the first one to post something, but they don't have time to make a quality image.

swer from the options 1. How many basic input devices does a desktop computer have? a)2 b)3 c)1 d)4 2. The computer equipment which feeds the computer with data is called a)Storage device b) Processing device c) Diskette d) Input device 3.When an output is displayed in a printed formitis termed as a)Softcopy output b) File c) Document d) Hardcopyoutput 4. Which computer device will convert human voice into digital voice? a) Projector b)Loudspeaker c) Microphone d) Joystick 5) All the following are hardcopy output devices except a) Photocopier b) Printer c) Projector d) Plotter 6. The computer device which is used to display the content of data to the user is called a) Input device b) Storage device c) Output device d) Pen drive 7)Which of these computer equipments will be used to display the content of data to a larger size of class during instruction or presentation? a) Television b) Monitor c) Projector d) Plotter 8. Which of these is example of non-impact printer? a) light printer b) Laser printer c) Dot matrix printer d)Daisywheel printer 9) The content of data which is displayed on a screen to the user is called. a) Output b)Hardcopy output c) Input d) Softcopy output 10) All these devices are examples of softcopy output devices except a) Projector a) Monitor c) Television d) Pinter​

Answers

Answer:

1. 3

2. D (Input Device)

3. D (Hardcopy Output)

4. C (Microphone)

5. C (Projector)

6. C (Output Device)

7. C (Projector)

8. B (Laser Printer)

9. D (Softcopy Output)

10. D (Printer)

Cheng, a student, is researching a company's profile on a professional networking website. In what way will this kind of research benefit her
most?
OA
getting recommendations from teachers
O B.
preparing for an interview
O C. upgrading her knowledge
O D.
building her brand profile

Answers

The way that this kind of research benefit her is by upgrading her knowledge.

What is research?

Research is known to  be a kind of making of new knowledge through the use of (or not) of previous knowledge in a novae and creative way.

Note that The way that this kind of research benefit her is by upgrading her knowledge as it will help her to have and get new concepts, methodologies and also have good understandings.

Learn more about research  from

om/question/968894

#SPJ1

Fern has set up a computer network for the entire building. Unfortunately, the signal strength diminishes as it reaches toward the computers away from the network source. Which devices should Fern employ to strengthen the signal? A. hubs B. switches C. repeaters D. gateways

Answers

Answer:

Repeaters

Explanation:

As the question points out, the signal strength diminishes (attenuates) as it travels farther from the source.  Deploying a repeater at critical points throughout the building would boost the signal strength as it continues on its way.

What would a world where we have 2^128 (340 undecillion) Internet connected devices look like? How could that much Internet usage make the world better?

Answers

A world  have 2^128 (340 undecillion) of IPv addresses that helps to connect to the internet. IPv6 addresses can make it easier for working organizational teams connecting to the Internet, IP addresses that are created by IPv6 are 128 bits.

What is internet?

Internet is the system  uses the Internet protocol suite (TCP/IP)  and interconnected computer networks that communicate between two or more individuals.

Today, almost 20 IP addresses are taken by7 each home for each electronic device. The internet usage is so wide, that even a simple task  is not possible without it. Even a simple task can be done using internet.

Learn more about internet.

https://brainly.com/question/13308791

#SPJ1

if you want to improve the overall quality and performance of your computer, which would you upgrade?
A. Monitor
B. Power Supply
C. RAM
D. ROM
Explain your choice

Answers

Answer:

RAM because it improves load times and has less ups and downs while under load

Discuss the variety of shapes and sizes in which cases come for desktops, laptops, tablets, smartphones, portable media devices, and game consoles.

Answers

Modern computers are comes in a multitude of designs, sizes, and designs. There is a computer form to suit each use, whether it's a massive tower under a desk or a small brick the size of, well, a brick.

How is a laptop different from a desktop?

A desktop uses an external monitor, keyboard, and mouse to be used at work or at home, whereas a laptop has all of these components integrated in and can be easily transferred as a single device that can be used in a number of locations.

Thus, Modern computers are comes in a multitude of designs, sizes, and designs.

For more information about laptop different from a desktop, click here:

https://brainly.com/question/19340665

#SPJ1

Other Questions
Whaf is Communism What is karl Marx's contribution to Communism Six men take five days to complete a job. How long wouldthe same job take fifteen men? Can some on help me How did white fans feel about Jackie playing inthe Major Leagues? Help me Technician A says that a flaring tool is used to form the end of piece of copper tubing to allow it to be connected using a flare nut and fitting. Technician B says that a double flare is used on connections that will be repeatedly loosened and retightened Which term is used to indicate the natural tendency of an object to remain at rest or in motion at a constant speed along a straight line? An insurance firm wants to estimate the percentage of senior citizens in a small town with approximately 2,534 residents. it asks a group of 85 randomly selected people in the town about their age. select the statement that is true. a. the sample is 2,534 people. the population is 85 people. b. the sample is 85 people. the population is 2,449 people. c. the sample is 85 people. the population is 2,534 people. d. none of the answer choices are true. The expression of x=4t+2t^2 Where x is distance and t=time What is displecement ? Which function is increasing on the interval ? (-,) A. i(x)=x^2+8x+1B. G(x)=-4(2^X)C. F(x)=-3x+7D. H(x)=2^x-1 A store is giving out cards labelled 1 through 10 when customers enter the store. If the card is an even number, you get a 10% discount on your purchase that day. If the card is an odd number greater than 6, you get a 40% discount. Otherwise, you get a 20% discount. The table shows the results of 400 customers. What is the relative frequency for each discount? Use pencil and paper. If the manager of the store wants to approximately half of the customers to receive the 20% discount, does this seem like an appropriate method? Explain. Frank bought a pair of gloves for $9.95 and a hat for $5.25. What is the best estimate of much he spent?$15.00$10.00$5.00$25.00 x/13 - 1 = 5x/2 + 1/2please answer the question pls pls pls pls HELP FASTTTT! WILL GIVE BRAINLIEST!Choose the word that does not belong.bananalettuceplumappleChoose the word that does not belong.MarkStephanieElizabethShonnaChoose the word that does not belong.ColossiansRomansGenesisActsList all the nouns, both common and proper, in the order in which they appear in the sentence.When Naomi decided to leave Moab, her daughters-in-law went with her. One companion turned back, but Ruth continued on the journey with her mother-in-law. Which expression is equivalent to 2.5((2x-5)-(5x+2))? 2. Qu calcetines llevo?OLlevo calcetines lila.OLlevo calcetines lilos.OLlevo calcetines lilas. Company ABC would like to select the topology that has the most reliability for data reaching its destination. Which topology should they choose?busfull meshpartial meshring Which of the following best explains the purpose of a demand schedule?A. To demonstrate how supply affects demand.B. To calculate how much of a good consumers will use.C. To indicate how supply and demand relate to price.O D. To show the level of demand at various prices. Solve for Unknown: x/10=43/46.Do not put variable, only put the number value to the nearest whole number please help meeeeeeeeeeeeeeeee The numbers in this sequence increase by 12 each time24364860The sequence is continued with the same rule.Which number in the sequence will be closest to 100?