Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write c++ code Write a C++ program that defines 2 functions for processing arrays using pointer based notation. 1 function should search through an array

Write c++ code
image text in transcribed
Write a C++ program that defines 2 functions for processing arrays using pointer based notation. 1 function should search through an array and return the smallest integer element in the array. The other must search for and return the largest integer element. Here are the function headers to use: int findsmallest(cont int. intArray, const int size) int findLargest(cont int intArray, const int size) . Test the program from main by prompting the user for how big the array should be. Next, dynamically allocate an array of the requested size and initialize it with random intgers in the range [-1000, 1000]. Next, call the 2 functions, store their return values, and display the results in a user-friendly format Note: Do not use square bracket notation [ 1 in this program, except for when using the new operator. Use only pointer notation to manipulate the array. Note: whenever you use dynamically allocated memory, it is critical that you remember to de-allocate the memory so that it is returned back to the operating system. ssi gnmen How many integers do you want in the array? 5 Elementeis:613 lement 1 is: .810 nt 2 is 14 ment 3 is: 929 ement 4 is: 43 Bigsest integer: 929 est Integer 81 Press any, key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

=+(17.24) ['If(x) dx Answered: 1 week ago

Answered: 1 week ago

Question

Consider some type of redress for the customer, such as a coupon.

Answered: 1 week ago

Question

Sell the quality of your brand or products.

Answered: 1 week ago