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

6. After you add the printer, you need to install a utility software that allows the computer to communicate with the printer so that you can control print jobs. What is this software called

Answers

Answer:

Printer Driver

Explanation:

a printer driver or a print processor is a piece of software on a computer that converts the data to be printed to a format that a printer can understand.

What are the real-life applications of coding?

Answers

Some example's of coding affecting real life:

Traffic LightsBiometric SecurityRobots used in factories. can work in extreme conditions.Automatic Heater or Air Conditioner.Expert Systems used in for Medical Use.Smart Self Driving Cars

How do we distinguish between remote and local information sources? give an example of each source? i'll give brainliest answer for who every answer it right

Answers

A local server means that you have a server setup on your current machine. A remote server is ran on a different machine

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:

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 have studied graphic design, advanced math, and programming, and you
love everything about video games. Which job is likely to be the best fit for you
A. database manager
B. game designer
C. project manager
D. website designer

Answers

B game Designer will be the job likely to be the best

Allan needs to ensure that an object is in a very precise location on a slide. He decides to use the Ruler option to achieve this. On which tab is the Ruler option found?

Answers

Based on the above scenario,  the tab that is where one can find the Ruler option is the View tab.

On which tab is the ruler option Seen?

One can see the ruler option in the View tab that is in the tool bar at the top of the slide screen. Then look for the Ruler option in the Show group.

Therefore,  Based on the above scenario,  the tab that is where one can find the Ruler option is the View tab.

Learn more about Ruler option from

https://brainly.com/question/16399272

#SPJ1

To insert a column without using commands in any tabs, a user can _____
-click and then click Insert Column.

fill in the blank

Answers

You can RIGHT click and then click insert column. Hope this helped!

PLEASE HELP! ITS A COMPUTER MCQ
The character that is displayed at the end of the code for continuation.
a. :
b. ;
c. .
d. ,

Answers

Answer:

b. ;

Explanation:

PLEASE MARK ME AS BRAINLIEST

What words are familiar to people involved with computers? printer network, mouse and monitor screen software

Answers

The words that are familiar to people involved with computers are network, mouse and monitor screen.

What is a computer?

A computer simply refers to an electronic device that is designed and developed to receive data in its raw form as an input and processes these data into an output (information), which could be used by an end user to perform a specific task through the use of the following:

KeyboardNetworkMonitor screenMouse

In Computer technology, we can logically infer that network, mouse and monitor screen are the words that are familiar to people involved with computers.

Read more on computer here: brainly.com/question/959479

#SPJ4

Answer:

B

Explanation:

network, mouse and monitor

Your client has acquired several small companies and would like to connect them together into one network. Not all of the routers are Cisco devices, and compatibility is a concern. Which WAN encapsulation method should you recommend your client use

Answers

Answer:

Extranet

Explanation:

Allows connection to other companies in a controlled manner.Provides access to Internet. permits workers to access information at any time.

Create a program in writecustomerlist. java that allows a user to input customer records (id number, first name, last name, and balance owed) and save each record to a file named customerlist. txt. have the program accept input until zzz is input for the id number. write the records to customerlist. txt in csv format, for example:

101,john,smith,107. 5

41,jill,green,20. 0

when you execute the program, be sure to enter multiple records that have the same last name because you will search for repeated last names in part 4 of this exercise.


write an application named displaysavedcustomerlist. java that reads the file created by the writecustomerlist application and displays the records.


write an application named displayselectedcustomer. java that allows you to enter any id number, reads the customer data file created in step 1, and displays the data for the customer. display the message no records found if the id number cannot be found in the input file.


write an application named displayselectedcustomersbyname. java that allows you to enter any last name and displays all the data for customers with the given last name. display the message no records found if the name cannot be found in the input file.


write an application named displayselectedcustomersbybalance. java that allows you to enter any purchase amount and displays all the data for customers with balances greater than the entered value. display the message no records found if no customers meet the criteria

Answers

Using the knowledge in computational language in JAVA, this code can be written as:

Writing code in JAVA:

public String toString() {

return this.firstName+" " + this.lastName ;

}

System.out.println("Enter First Name: ");

   String firstName = input.nextLine();

   System.out.println("Enter Last Name: ");

   String lastName = input.nextLine();

   System.out.println("Enter Home Address: ");

   String homeAddress = input.nextLine();

   Customer cus = new Customer(firstName, lastName, homeAddress);

   System.out.println("\nWelcome: ");

   System.out.print(cus.getFirstName() + cus.getLastName());

   System.out.println("\n Your Shipping Address: ");

   System.out.print(cus.getHomeShippingAddress());

   List<Customer> customer = new ArrayList<Customer>();

   customer.add(cus);

   printList(customer);

}

public static void printList(List<Customer> list) {

   System.out.println("Customers: ");

   for (Customer customer : list) {

       System.out.printf("%s", customer);

   }

   System.out.println();

}

This JAVA code describes a program in writecustomerlist. java that allows a user to input customer records.

See more about JAVA at brainly.com/question/12975450

#SPJ1

Which of the following indicate a problem with the laptop battery? • The laptop running slowly • Some applications will not run ● The laptop gets switched off when mains switch is off The laptop doesn't boot ●​​

Answers

Answer:
The correct answer would be D, (or the last one).

The option that  indicate a problem with the laptop battery is the laptop gets switched off when mains switch is off.

What causes a laptop not to switch on?

The main reason is that the  laptop has a faulty power supply or when the battery is faulty or there is a failed hardware.

Note that The option that  indicate a problem with the laptop battery is the laptop gets switched off when mains switch is off.

Learn more about laptop  from

https://brainly.com/question/16045385

#SPJ2

Who completes the action item form in a team meeting

Time keeper
Scribe
Recorder
Team leader
Gate keeper

Answers

Answer:

Recorder

Hope this helped! I'm not 100% if this answer is correct, though

Recorder completes the action item form in a team meeting. Thus, option C is correct.

Who is a Team Leader?

Team Leader refers to a person that is in charge of a group of people and helps them to achieve a common goal. Please note that your question is incomplete so I gave you a general overview to help you get a better understanding of the concept.

A team leader can be found in the army as a General, in business industries, and even a president can be referred to as a team leader.The Gate Keeper is typically a role that is assigned to a person who is responsible for ensuring that the meeting runs smoothly and productively.

The Gate Keeper's primary responsibility is to manage the flow of information and ensure that all participants have an opportunity to contribute and that the meeting stays on track.

Therefore, Recorder completes the action item form in a team meeting. Thus, option C is correct.

Learn more about Recorder on:

https://brainly.com/question/31388398

#SPJ2

Mille gets a text from her friend asking if she wants to come over. It seems like a bit of a hassle to go to her friend's house, especially when they
could watch online videos together and talk over the phone. What is the BEST advice for Millie?
OA. Her friend will probably be relieved If she does not come over.
OB. They should just say whatever they want to say to each other over social media.
OC. It will be a more positive experience if she spends time with her friend in person.
OD. If they are doing the same activities virtually as they would if they were together, it does not make much difference.

Answers

Answer:

OC. It will be a more positive experience if she spends time with her friend in person.

Explanation:

You should always spend time with people in person rather than online whenever you get the chance.

what are project scope requirements?

Answers

Explanation:

Defining project scope requires input from the project stakeholders. They work with project managers to establish the key elements of budget, objectives, quality and timeline. To determine scope, project managers must collect requirements for what the stakeholders need from the project.

Answer:

The project scope outlines all the work required to deliver a project.

Explanation:

as well as any factors that define project sucess.

When analyzing an image, you should consider composition, lighting, and

O A. sound

OB. captions

OC. quantity

OD. color

Answers

Answer:

Color

Explanation:

I think it's relatively self-explanatory. An image does not have sound, and neither captions nor quantity matter with analyzation

how many questions are on the ap computer science principles test

Answers

Answer:
70.

Explanation:
The 2021 AP Computer Science Principles Exam is 2 hours long and includes approximately 70 multiple-choice questions. There will be three types of questions: Single-select questions (57 questions).

Hope this help’s!
Please give Brainliest!

Write a program that calculates the amount of money a person would earn over a period of time if his or her salary is on one penny the first day, two pennies the second day and continues to double each day. The program should ask the user for the number of days. Display a table showing what the salary was for each day, then show the total pay at the end of the period. The output should bd displayed in a dollar amount, not the number of pennies. Must use for loop statement. Need to check the input value is correct, otherwise an error message is displayed. Display a nicely formatted table. Display the salary in dollar and cents

Answers

The program that calculates the amount of money a person would earn over a period of time if his or her salary as well as other factors inclusive is written below.

What is the program about?

The raw form of the program is:

#include <iostream>

using namespace std;

int main(){

   const int increment=2;

   int day;

   float penny=.01,

          total=0.0;

   cout <<"How many days have you worked? ";

   cin  >>day;

   while (day<1){

       cout<<"The number must be greater than 1.\n";

       cout<<"Enter again: ";

       cin >> day;

   }

   for (int i=1; i<=day;i++){

       total+=penny;

       cout <<" Day "<< i <<" "<< " $"<<penny<<endl;

       penny*=increment;

   }

    cout<<"Total salary for  "<<day <<" days = $" <<total<<endl;

Learn more about program from

https://brainly.com/question/23275071

#SPJ1



If I want to make it look like slide number one is turning a page to slide number two, what
effect needs to be applied?

Answers

Answer:

Im not certain but I think thwir is one called flip

Explanation:

Kind of works like a book if thats what your asking for

Consider a career as a multimedia artist. is there a company, film, game, or band whose signature multimedia design work interests you? choose one of them and on the internet, research the company responsible for the development of that design, exploring the about pages to learn about the multimedia artists responsible. choose one or two of those artists and find out how they learned their craft. in particular, check to see if the artist(s) invented some feature of that design or a development method that helped complete the work they envisioned.

organize your work. write a minimum three-page paper and include a media presentation:

-a slideshow with at least ten slides;
-a video of at least four minutes;
-another medium form of your choice, making sure it is of comparable length; or
-a multimedia presentation combining an appropriate amount of each medium form.

Answers

Based on the scenario above, The career as a multimedia that I chose is Multimedia Designer.

Who are Multimedia artists?

This is known to be a person who uses  computer programs and illustrations to form graphics and also create animation.

Note that they help in the creation of movie, game and others such as visual effect.

A multimedia presentation is known to be a kind of presentation that uses a lot of forms of digital communication, such as video, and others.

Learn more about career from

https://brainly.com/question/15169081

#SPJ4

As a network administrator of your company, you have decided to implement redundant connections between network devices to solve problems like network bottlenecks. You have decided to implement this change so that multiple network interfaces and ports can act as one logical interface and focus on increasing total throughput and better load balancing. Which of the following will you use to implement this change in your Windows devices?a. Layer 4 switchesb. ToR switchesc. EoR switchesd. Layer 3 switchesAs a network administrator of your company, you have decided to implement redundant connections between network devices to solve problems like network bottlenecks. You have decided to implement this change so that multiple network interfaces and ports can act as one logical interface and focus on increasing total throughput and better load balancing. Which of the following will you use to implement this change in your Windows devices?a. Load balancingb. NIC teamingc. Clusteringd. Port aggregationYou run a website called Offhand that sells exclusive handmade home decor items. On Mother's Day, the website unexpectedly receives a burst of traffic following the marketing campaign designed for this occasion. Thankfully, you are equipped with a good cloud service model and hence you are able to increase the cloud resources the website needs without disrupting your web services. Which of the following cloud characteristics helped you manage the situation easily?a. Measured service.b. Resource pooling.c. Rapid elasticity.d. Broad network access.

Answers

The option that you will use to implement this change in your Windows devices is  Layer 3 switches.

What are the layer 3 switches?

A Layer 3 switch is is known to be one where a switch can carry out routing functions and also do its  switching.

Note that The option that you will use to implement this change in your Windows devices is  Layer 3 switches.

Learn more about  Layer 3 switches from

https://brainly.com/question/14594641

#SPJ1

if a user watches a video with event tracking three times in a single session, analytics will count how many unique events?

Answers

Answer:

1

Explanation:

Analytics will count it a One (‘1’) Unique Event, even if a user watches a video with event tracking three times but in a single session.

What is an example of using the internet of things (iot) to deliver innovative cloud-based solutions to customers?

Answers

Answer:

Wearable technology

Explanation:

An example of using the Internet of Things (IoT) to deliver innovative cloud-based solutions to customers is the wearable technology that provides customers with on-the-spot personalized experiences.

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.

A UNIX or Linux system might identify a file as: /usr/imfst/flynn/inventory.doc. The first entry is a forward slash ( / ) representing the master directory, called the ____ directory. a.root b.working c.main d.branch

Answers

Answer:

C

i cant give you an explaination on why it is like that but C sounds and seems the correct one

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

Types in java are divided into two categories. the primitive types are boolean, byte, char, short, int, long, float and double. all other types are ________ types

Answers

types in java are divided into two categories. the primitive types are boolean, byte, char, short, not, long, float, and double. all other types are REFERENCE types

Display network involves (select one):_________
a. Advertisers coordinating their display ads to show up on various websites at the same time
b. Advertisers that want to pay to display their ads coordinating with websites wanting to display those ads
c. Advertisers that want to increase display ad effectiveness working with search engines on maximizing webpage placement
d. Advertisers coordinating display ad campaigns to align with other advertising efforts such as search advertising

Answers

Display network involves Advertisers that want to pay to display their ads coordinating with websites wanting to display those ads.

What is a display advertising network?

This is known to be a group of websites, videos and apps where a person ads can appear and it is one that has a lot of Internet users worldwide.

Note that Display network involves Advertisers that want to pay to display their ads coordinating with websites wanting to display those ads.

Learn more about Display network  from

https://brainly.com/question/2780939

#SPJ1

a colleague shared an excel file with you, and you want to display a worksheet that is hidden in it. how can you do that?

Answers

The hidden worksheet can be made visible with the right click on any worksheet and select unhide.

What is a worksheet?

A worksheet in Microsoft Excel is the collection of the rows and column that has been used to organize data. The collection of worksheets is called workbook.

The hidden worksheets are not visible in the workbook, and if an individual wants to unhide the hidden worksheet, he must right-click on any worksheet and select unhide.

Learn more about worksheet, here:

https://brainly.com/question/1024247

#SPJ1

Other Questions
Please help me. I dont know the answer. If 50 grams of CaCl2 is dissolved in 100g of water at 10 degrees. Is the solution saturated, unsaturated, or supersaturated? Jonathan brought out yogurt and fruit for the children. ~In small bowls~Where should the 'In small bowls' go?A. After 'brought'B. After 'out'C. After 'yogurt'D. After 'Jonathan'Please help, this is for my little brother! Thanks! 2+2 son pea los anuncios What is the tone of senator McCarthy's speech? Schizophrenia is a mental disorder that is often confused with __________ disorder.A.dissociative identityB.obsessive-compulsiveC.conversionD.bipola find arc JKBRAINLIEST,POINTS,THANKS AND RATING GIVEN!!! Does anyone know the answers or how to do this? Which of the following is a synthesis reaction?a) 2KCIO3 2KCl + 302O b) 2 C4H20 + 13 02 + 8 CO2 + 10 H20O c) Fe + CuCl2 FeCl2 + CuO d) 4 A1+3 02 2 Al2O3 Please Help me (i will give brainly ) Is the following graph linear, exponential or quadratic? One criticism of resource-mobilization theory is that it a. minimizes the importance of deprivation and dissatisfaction. b. only applies to revolutionary movements. c. does not apply to movements in industrial societies. d. only applies to college students. please select the best answer from the choices provided a b c d Which of these company figureheads is not a real person? chef boyardee juan valdez colonel sanders duncan hines. An artistic style is specific to a single culture. true false Write an equation to match each graph.I already tried y=[x] that didnt work 3 + 4ab+ 4ab - 5b + mNumber of terms:Coefficients:Constant terms:Somebody help me If function f : R --> R where f(X)=X - kX + 12X - 7 is a one to one function, then k belongs to.... Move a phrase and number to the blanks to complete the sentence. Fatihah __________________ (bring) a lot of Chemistry papers. what parameters affects the inductance of a coil Medgar Evers William L. Moore Dr. Martin Luther King, Jr.The men above were all A. integral to the ruling of the Brown v. Board of Education case. B. civil rights leaders who lost their lives during the movement. C. African American mayors elected during the Civil Rights Movement. D. civil rights leaders who helped write the Civil Rights Act of 1964.