Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ program on visual studio. Part 2a: Calculating the Maximum and Minimum of an Array See example 3, 4 & 5 for examples that may

C++ program on visual studio.

image text in transcribed

image text in transcribed

image text in transcribed

Part 2a: Calculating the Maximum and Minimum of an Array See example 3, 4 & 5 for examples that may help you solve this problem Before you start, study and understand example 4 above. Then uncomment the commented-out line in the function display it and recompile. This will demonstrate to you the purpose of the keyword Const Complete this program: add two functions (& their prototypes) that return the maximum and minimum value of an array of x elements. The program should ask the user for these x elements Hint: the functions will return a single integer value, and should have 2 parameters: the array (passed as a constant array), and the numbers of values in the array Question: do the min element and max element functions modify the arrays in any way? If not, then the array parameter (in both the function prototype and the function definition) should be declared "const". While your functions will work just fine without the keyword const, it is better to use it here. That signals to readers of your code that the array will not be modified by the function, and would trigger a compiler error if you tried to modify the array inside the function. This is one of C++'s features that helps reduce human error. Name your program minmax array.cpp

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions