You MUST use pointers and dynamic allocation to complete the following exercise to receive points. Write a program that takes a positive integer as input, indicating the number of integers (separated by whitespaces) that will follow. (1) Create a dynamic integer array with the size equal to the value of the first input integer to store the user input values. If the first input integer is not positive, the program will output "Invalid size!" and exit. (2) Find and print out the maximum even number and maximum odd number in the entered integer array. Ex: if the input is: 5 43 5 0 23 9 the program would output: The maximum even number is 0 The maximum odd number is 43 You MUST define and call the following two functions to return the memory addresses of the elements that store the maximum even number and maximum odd number, respectively. Both functions take the dynamically created integer array and its size as input. int *findMaxEvenNumber(int *array, int size); int *findMaxOddNumber(int *array, int size); NOTE For the function of finding the maximum even number, if the entered array does not have an even number, it will return a nullptr pointer. The same for the function of finding the maximum odd number. If no even number exists in the array, the program will return No even number in the array The maximum odd number is Similarly, if no odd number in the array, the program will output The maximum even number is No odd number in the array

Answers

Answer 1

A program that takes a positive integer as input, indicating the number of integers.

#include <iostream>

using namespace std;

int maxEven=-999; //Takes only integer value

int maxOdd=-999;

int *findMaxEvenNumber(int *array,int size)

   for(int i=0;i<size;i++)

   {

       if(array[i]%2==0 && array[i]>maxEven)

           maxEven=array[i];

   }

   return &maxEven;

}

int *findMaxOddNumber(int *array,int size)  

   for(int i=0;i<size;i++)

   {

       if(array[i]%2==1 && array[i]>maxOdd)

           maxOdd=array[i];

   }

   return &maxOdd;

}

int main()

{

   int n,i=-1;

   int *arr;

   do  

   {

       if(i==-1)

       {

           cin>>n;

           arr = new int(n);

       }

       else

           cin>>arr[i];

       i++;

   }

   while(i<n);

   int *even,*odd;

   even=findMaxEvenNumber(arr,n);

   odd=findMaxOddNumber(arr,n)

   if(*even==-999)

       cout<<"No even number in the array"<<endl;

   else

       cout<<"The maximum even number is "<<maxEven<<endl;

    if(*odd==-999)

       cout<<"No odd number in the array"<<endl;

   else

       cout<<"The maximum odd number is "<<maxOdd<<endl;

   return 0;

}

Learn more about integer here:

https://brainly.com/question/14592593

#SPJ4


Related Questions

In order to define dimensions of a Sketch of an Extrude properly we need to do the following: Select the references to locate the Sketch Select the Part Edges that may serve as a reference Create refe

Answers

To define dimensions of a Sketch of an Extrude properly we need to select the references to locate the Sketch and select the Part Edges that may serve as a reference.

A Sketch of an Extrude is a drawing that allows the representation of the features of an extrusion product. To define dimensions of a Sketch of an Extrude, we need to do the following steps:Step 1: Select the references to locate the Sketch.To create a sketch of an extrude, we need to select the plane that would serve as the surface for the sketch. After selecting the plane, we need to locate the sketch in the plane by selecting the references. References are the points on the surface that would be the base for the sketch. We need to locate these points in order to place the sketch accurately.

Step 2: Select the Part Edges that may serve as a reference. After selecting the references, we need to choose the part edges that may serve as a reference for the sketch. These part edges would define the thickness and other properties of the extrusion product. Therefore, selecting them accurately is crucial for the proper definition of dimensions of a Sketch of an Extrude.

Know more about Sketch, here:

https://brainly.com/question/15947065

#SPJ11

How many questions are on TestOut Security Pro certification?

Answers

There are fifteen questions in the TestOut Security Pro certification test, around a dozen of them are lab simulations.

When passing the exam involves completing a setup assignment or drag-and-drop exercise that simulates a real-world security situation

Since it is an assignment for the course, I won't go into any significant depth about what is involved. But I will say this: You should revisit any Testout tutorial you can recall that covered using the Group Policy editor. In addition, I would suggest reading up on switch security in the "Network" lessons because the configuration jobs I encountered included a number of difficult-to-navigate elements.

Finish all the labs that are necessary for the course. You are simply "needed" to do anything each week in order to receive a score.

Learn more about Testout here:

https://brainly.com/question/29440544

#SPJ4

A speed limit sign that says "NIGHT" indicates the _____ legal speed between sunset and sunrise.

Answers

Answer:

Maximum

Explanation:

Speed limits indicate the maximum speed you are legally allowed to drive.

I am looking for code HS 3.4.5 in Technology

Answers

Answer (Code):

penup()

backward(100)

def bottom_line():

left(120)

color("red")

forward(100)

def triangle():

left(120)

color("blue")

forward(50)

left(120)

color("green")

forward(50)

pendown()

pensize(5)

color("red")

forward(50)

for i in range(4):

triangle()

bottom_line()

Business intelligence (BI) is a narrow term that refers to specific architectures, tools, databases, analytical tools, applications, and methodologies. (True/False)

Answers

True. Business intelligence (BI) is a term that specifically refers to the various architectures, tools, databases, analytical tools, applications, and methodologies that are used to gather, store, analyze, and present business information in a way that helps organizations make more informed decisions.

True. Business intelligence (BI) refers to specific architectures, tools, databases, analytical tools, applications, and methodologies that are used to collect, analyze, and present data for better decision-making in a business context. These components work together to help organizations make more informed decisions and improve overall performance.

Business intelligence (BI) includes the techniques and strategies companies use to analyze data and manage business information. The main functions of business intelligence technology include reporting, online analytics, analytics, dashboard development, data mining, mining techniques, complex operations, performance management, metrics, data mining, predictive analytics, and analytics.

Business intelligence (BI) includes the techniques and strategies companies use to analyze data and manage business information. The main functions of business intelligence technology include reporting, online analysis, analytics, dashboard development, data mining, process mining, complex operations, performance management, measurement, data mining, forecasting, and analysis.

Learn more about the Database:

brainly.com/question/30634903

#SPJ11

write the algorithms for the problem How to post a letter ? you can put pictures for the steps ​

Answers

❖ Step 1: Start

❖ Step 2: Write a letter

❖ Step 3: Put in envelope

❖ Step 4: Paste stamp

❖ Step 5: Put it in the letter box

❖ Step 6: Stop

\(\frak{\fcolorbox{black}{pink}{Black Pink in your area$~$}}\) ~←(>▽<)ノ

What does it mean to get optional from school? And is it like to have optional for school?

Answers

Answer:

"Getting optional" from the school typically means that a student can leave school early or not attend classes for a certain period. This can happen for various reasons, such as medical issues, personal circumstances, or disciplinary actions.

"Having optional" for school means that students have the choice to attend or not attend certain classes or activities. This is often offered to students who have already completed the required coursework or are excelling in their studies and would like to take more advanced or specialized classes.

Explanation:

30 points for this.
Any the most secret proxy server sites like “math.renaissance-go . Tk”?

Answers

No, there are no most secret proxy server sites like “math.renaissance-go . Tk”

What is proxy server sites

A proxy server functions as a mediator, linking a client device (such as a computer or smartphone) to the internet.  Sites operating as proxy servers, otherwise referred to as proxy websites or services, allow users to gain access to the internet using a proxy server.

By utilizing a proxy server site, your online activities are directed through the intermediary server before ultimately reaching your intended destination on the web.

Learn more about   proxy server sites from

https://brainly.com/question/30785039

#SPJ1

which command can an administrator execute to determine what interface a router will use to reach remot netowrks

Answers

Determine the path between two connections by using the traceroute command. A connection to another device frequently needs to pass via several routers.

How do I get my Cisco router's interface status?

Use the show interface summary command to provide a summary of the system interfaces' details. There are no arguments or keywords for this command. Use the show interface command to display the system interfaces' details. information about the redundancy management interface is displayed in full.

What router command would a system administrator enter to check whether the exit interface was operational?

The show is interface short command can be used by the network administrator to check that the interface connected to the next hop address or the exit interface is operational. To check if the next hop address is reachable, use the ping command. The routing table is displayed via the show IP route command.

to know more about routers here:

brainly.com/question/29768017

#SPJ4

In which era was theater the most popular performing art in Europe?

18th century
Renaissance
early 20th century
19th century

Answers

Renaissance era, it was mid 1500s to 1600s.

Scenario 2: You work for a large organization with 15 departments. A new leadership initiative to centralize systems includes requiring all employees to use the same OS and computers. Currently, some departments use Windows and others use macOS; some desktops within those departments have Linux-based systems. It has been discovered that some departments are still operating older OS versions, which has negatively impacted their productivity. For customer-facing departments, the SalesForce CRM is being implemented. Implementation of this CRM is what encouraged the leadership team to start a centralized initiative to have more systems connect to that CRM.With that Scenario above, I need to answer and discuss the questions listed below. I have to make a recommendation on what OS to implement and go from there.Make an OS recommendation based on your chosen scenario and provide a strong rationale.Answer the following questions:Given what is described in the scenario, what OS and version do you recommend be implemented?Should more than one kind of OS be implemented? If so, which ones?What are software and hardware requirements that support your decision?What else helped you make the decision to recommend specific OSes?If you had some difficulty making a recommendation, discuss what additional information you would need to make a well-informed decision.If you make assumptions beyond the information in the scenario that you've chosen, make sure you state them in your initial post.

Answers

Based on the given scenario, it is recommended to implement Windows 10 OS. Windows 10 OS and version are recommended to be implemented. No, it is not recommended to implement more than one kind of OS because it will be difficult to manage and maintain.

The software and hardware requirements to support Windows 10 OS include Processor: 1 gigahertz (GHz) or faster processor or System on a Chip (SoC)RAM: 1 gigabyte (GB) for 32-bit or 2 GB for 64-bitHard disk space: 16 GB for 32-bit OS 20 GB for 64-bit OSGraphics card: DirectX 9 or later with WDDM 1.0 driver display: 800x600.

The decision to recommend Windows 10 OS was made based on the fact that Windows is more widely used and has better compatibility with most software applications. Also, the fact that some departments are still operating older OS versions that have negatively impacted their productivity makes it necessary to upgrade to the latest OS.

Additional information that would be required to make a well-informed decision includes the specific hardware and software requirements of the applications used by the organization and the compatibility of these applications with different OSes. This information will help to determine if any other OS can be implemented besides Windows 10 OS.

To know more about OS: https://brainly.com/question/1033563

#SPJ11

Using the information below, answer the question to the right. Which function should you use to extract shipping values from the Lookup Table?

Using the information below, answer the question to the right. Which function should you use to extract

Answers

Answer: HLookup

Explanation:

HLookup is a function in Microsoft Excel that is part of the Lookup functions, that is, it is used to lookup a value from another table or cell so that it reflects in the desired table.

The “H” in the HLookup stands for Horizontal, that is Horizontal Lookup.

The HLookup function works by looking for a value in the top row of a table or array of values and returning the value in the same column from a row that is specified.

The function is;

=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])

So, to extract our shipping value from the lookup table, we use the formula;

=HLOOKUP(C2,$B$11:$E$12,2)

a person who uses computers to gain unauthorized access to data.

Answers

Answer:

Hacker

Explanation:

They break password codes to get access to unauthorized data.

Answer:

a hacker

Explanation:

a. How iong, on arenage, does it take to complete the entire process for a group portrait? 30 minutas. (Enter your response as an integer) b. What shole actity is the totteneck for the entire process, assuming the process receives equal amounts of both groups and individuale? c. Whut is the onganey of the botllereck per hour? The cegacty e the bottleneck for indlviousis is customers and the capasty ef the betlleneck for groups is depending on if they want a single or group portrait they go to different rocms. Finairy everyone picks up their own finished portrait.

Answers

In conclusion, the entire process for a group portrait takes an average of 30 minutes. The bottleneck activity for the process depends on whether the customer wants an individual or group portrait, which determines the room they go to for the photo shoot.



The whole activity that acts as the bottleneck for the entire process, assuming equal amounts of both groups and individuals, depends on whether they want a single or group portrait. This determines which room they go to for the photo shoot.

The capacity of the bottleneck per hour is dependent on the number of customers for individuals and the capacity for groups. For individuals, the bottleneck is the customers themselves. However, the exact capacity is not specified. For groups, the bottleneck capacity depends on whether they want a single or group portrait, which determines which room they go to for the photo shoot.
To know more about conclusion visit:

https://brainly.com/question/28832812

#SPJ11

A communications closet has a device that contains 48 ports. The device's sole function is to provide the ports. What type of device is in the closet?

Answers

Answer:

Patch panel.

Explanation:

In this scenario, a communications closet has a device that contains 48 ports. The device's sole function is to provide the ports.

Hence, the type of device that is in the closet is a patch panel.

In Computer Networking, a patch panel can be defined as a passive hardware device in a local area network (LAN) which comprises of ports that are primarily used for the connection and management groups of incoming and outgoing LAN cables for network devices. The main purpose of a patch panel is to neatly connect and organize LAN cables such as RJ-45 cables, fiber-optic cables, cat 5 or 6 cables, telephone lines etc.

Additionally, a patch panel typically helps network engineers or owners to mitigate the problem of cable cluttering, reduced cable costs, easier maintenance of cables.

How is the search engine different from web directory and pls within 5 mins

Answers

Answer:

The search engine is different from a web directory because a web directory is a written list of websites to aid in exploring the Web, whilst a search engine finds the best and closest matched websites to what you typed in the search bar to help you with what you searched up.

Which of the following is the best way to determine the correct workplace for a new designer?

(A) Job fairs

(B) Interships

(C) College classes

(D) Graduate school

Answers

Answer:

b

Explanation:

A flower is an example of _______________? (Select the best answer.)

Question 2 options:

Water


Soil


Fauna


Flora


Air

Answers

Answer:

flora

Explanation:

Flora is plant life; fauna refers to animals. Fauna derives from the name of a Roman goddess, but the handiest way to remember the difference between flora and fauna is that flora sounds like flowers, which are part of the plant world; fauna, however, sounds like "fawn," and fawns are part of the animal kingdom.

I don’t quite understand the context of the question but if I were to guess, I would say the answer is “Flora” because it also means “relating to flowers.”

C. Allowing a mining company to use a natural lake to discharge waste

Answers

The discharge waste into natural lakes by mining companies can have severe environmental impacts such as eutrophication, harmful algal blooms, destruction of aquatic habitats, and harm to aquatic organisms, which can ultimately impact human health and the economy.

Can you provide more information on the environmental impact of discharging waste in natural lakes by mining companies?

The scenario presented in the paragraph describes a potential environmental impact assessment.

The assessment evaluates the impact of an industrial activity on the environment, social and economic aspects of a specific area.

The proposed activity in this case is a mining operation, and the assessment identifies potential environmental impacts of the activity such as pollution, damage to aquatic ecosystems, and displacement of local communities.

The option of allowing a mining company to use a natural lake to discharge waste is one of the potential alternatives for managing the waste generated from the mining operation.

The impact assessment would evaluate the potential risks and benefits of this option, including the long-term effects on water quality, public health, and the local ecosystem.

Learn more about discharge waste

brainly.com/question/16138430

#SPJ11

Choose the terms that best complete the sentence.
a
usually has faster connection and transmission speeds than a
.

Answers

A local area usually has faster connection and transmission speeds than a Wide area.

What is local area address?

The term LAN means Local Area Network as it is one that helps to link shared resources and Internet connection.

Note that A local area usually has faster connection and transmission speeds than a Wide area as it covers only a small area of place.

Learn more about  local area  from

https://brainly.com/question/25192887

#SPJ1

which monitor will you prefer in your school crt or fpd and why?​

Answers

Answer: CRT

Explanation: because just because

TRUE/FALSE. host based firewalls are used to permit/deny connections to selective services on a give host from specific network or ip ranges

Answers

The statement is true because that is one of the main functions of a host-based firewall.

A host-based firewall is a software-based security system that is installed on individual hosts or servers to protect them from unauthorized access and network-based attacks. Host-based firewalls are designed to filter incoming and outgoing network traffic based on various criteria, such as source and destination IP addresses, ports, protocols, and applications.

By using a host-based firewall, an administrator can define rules that specify which services, applications, or ports are allowed or denied access from specific network or IP ranges. For example, an administrator can configure a host-based firewall to allow incoming SSH connections only from a specific IP range, or to deny all incoming traffic except for HTTP and HTTPS traffic.

Learn more about host-based firewall https://brainly.com/question/30006064

#SPJ11

similarities between human and computer​

Answers

Answer: Both have a center for knowledge; motherboard and brain. Both have a way of translating messages to an action. Both have a way of creating and sending messages to different parts of the system.

Research jobs in digital media. Using a job-posting site like Indeed, Monster, Career Builder, or other sites, search for a job in your area. Once you identify a job in digital media that you may want to do, research the qualifications and education needed to perform this job, Write a paper of at least 300 words that includes:
a description of the job posting;
an explanation of the job duties or requirements;
an explanation of what kind of training the job requires;
a description of what you learned by contacting the company or researching a specific training program;
a description of why you are interested in this job; and
a description of how this job is related to digital media.

Answers

A 3D specialist, animator, digital graphic artist, web developer, marketing specialist, game developer, software designer, multimedia consultant, technology journalist, film effects developer, and many other positions are available in the field of digital media.

What is digital media?

Any communication tool that uses one of several encoded, machine-readable data formats is considered digital media.

On a digital electronics device, digital media can be produced, viewed, shared, altered, listened to, and archived.

Therefore, It is not necessary to have a formal degree to work in this field. One only needs curiosity in editing visual media, as well as expertise in the computer systems and applications used in digital video/film editing.

To learn more about digital media, refer to the link:

https://brainly.com/question/28086757

#SPJ1

.
It matters if you capitalize your search words in a search engine
True
False

Answers

Answer:

false

Explanation:

search engines really don't care. they'll find the answer almost always whether or not you capitalize things

Virtual reality simulates a three-dimensional environment with which users can explore and interact. True or false?.

Answers

Main Answer:

Virtual reality simulates a three-dimensional environment with which users can explore and interact. True.

Sub heading:

what is three dimensional?

Explanation:

1.Three-dimensional space is a geometric setting in which three values are required to determine the position of an element.

2.This is the informal meaning of the term dimension.

3.In mathematics, a tuple of n numbers can be understood as the Cartesian coordinates of a location in a n-dimensional Euclidean space.

Reference link:

https://brainly.com

Hashtag:

#SPJ4

A source of emf is connected by wires to a resistor, and electrons flow in the circuit. The wire diameter is the same throughout the circuit. Compared to the drift speed of the electrons before entering the resistor, the drift speed of the electrons after leaving the resistor is.

Answers

The drift speed of the electrons after leaving the resistor is same.

What is drift speed?

Drift is the sluggish approach to something or anything. Drift velocity is the average speed of charged particles moving through a medium as a result of an electric field.

The average speed at which electrons "drift" in the presence of an electric field is known as drift velocity. The electric current is a result of the drift velocity (or drift speed). Thermal velocity, on the other hand, results in random motion that generates collisions with metal ions.

A change in mass causes an electron moving in a crystal lattice to move similarly to a free electron, as was previously demonstrated. This fact enables us to describe the motion of electrons and holes in a semiconductor device using the classical equations of motion.

To learn more about drift speed refer to:

https://brainly.com/question/12911661

#SPJ4

3.
The process of displaying the information from the table is called
a. Query
Form
b. Report
. d Wizard
00​

Answers

Explanation:

the process of displaying the information from the table is called query

hey friend your answer is here I hope it will be helpful you please mark as brainiest answer thank you

What must authorized personnel do before permitting another individual to enter a Sensitive Compartmented Information Facility (SCIF)?

Answers

When another individual needs to enter a Sensitive Compartmented Information Facility (SCIF) authorized personnel must confirm the individual's need-to-know and access before permitting him to enter.

What is Sensitive Compartmented Information Facility (SCIF)?

It’s a U.S. Department of Defense term used to refer to a secure room or data center that protects confidential information (military and security) against electronic surveillance, cyberattacks and data leakage.

SCIFs can be permanent or temporary and can be installed in official government buildings. Access to SCIFs is restricted to authorized personnel. The Defense Intelligence Agency (DIA) have direct authority over them.

Learn more about Sensitive Compartmented Information Facility (SCIF) here: https://brainly.com/question/30160202

#SPJ4

The characteristics and purpose of expansion cards ​

Answers

Answer:

Expansion cards make processor systems adaptable to the needs of the user by making it possible to connect various types of devices, including I/O, additional memory, and optional features (such as a floating point unit) to the central processor.

Explanation:

Other Questions
Johns weekly salary is $428.25. His employer is changing the pay period to semimonthly. What will Johns semimonthly salary be to the nearest cent? In the summer of 2008, consumers indicated that they were less optimistic about the future of the economy. Such a change in sentiment is likely to Group of answer choices shift aggregate demand to the left. increase output. decrease unemployment. increase prices. What is the type of metabolism that occurs when energy is created with a balance of adequate oxygen and nutrients? how can you comment to "am so disappointed that you chose not to play rugby at your school and do ballet instead. all boys should play Rugby otherwise they are not men" Determine the slope of the line that contains the points A(4, 8) and B(7, -4). Crystal is a junior in high school. Her grades have not suffered since she took on a part-time job. She likely works: less than 20 hours a week. A cuboctahedron has 6 square faces and 8 equilateral triangle faces. It can be made by slicing off the corners of a cube, as shown. If each edge of a cuboctahedron has length 32 cm, find the volume of the cuboctahedron.(Hint: Find the volume of the original cube, and subtract the volume of the corners that are removed.) What did the drowned forests in cascadia show scientists about the size of past earthquakes in the region? A bond has a par value of $1,000, a time to maturity of 5 years, a coupon rate of 10% with interest paid semi-annually, and a yield to maturity of 12%. a. What is the price of the bond? b. What is the current yield of the bond? c. What is the duration of the bond? d. What is the expected price of the bond described in part (a), but one year from today? the instructive model of lineage commitment asserts that: the instructive model of lineage commitment asserts that: coreceptor engagement with mhc generates distinct signals for cd4 and cd8. engagement of cd4 leads to down-regulation (decrease) of cd8. engagement of cd8 leads to an increase in gene expression for activities specific to cytotoxic t cells. the first two answers only. all of these. Who were the Gazis, and what role did they play in building the Ottoman Empire?A.) children of sultans who were raised to lead armies of conquest into other Muslim landsB.) weapon used by ottoman fighters to slaughter or frighten their enemies into joining the empireC.) captured Christian children who were raised as slaves and given special privileges in return for loyalty D.) fearless warriors who fought to spread the faith of Islam thereby expanding the empire. what does it mean to present a document online? This is a 45 - 45 - 90 triangle. What is the measure of x? NEED HELP!!! Please answer the question! WILL GIVE BRANILY! 15 POINTS!!! pls help i dont understand Solve the problem. a runner jogs 4mi east then 3mi south. what is the bearing from his starting point? The antagonist in "The Most Dangerous Game brags that he hunts the mostdangerous animal of all. What is ironic about this claim? Suppose the random variable Y has a mean of 100 and a variance of 64. Let Z = [1/SQRT(64)] * (y-100)a. show Uz = 0b. Show (SIGMA)z2 = 1 Stock price is an indicator of a firms performance. Discuss some incentives for managers to manipulate earnings in order to increase their firms stock price ? I need helpppppppppp!!!!