Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write down C++ code E.3 Modifying an Array of Integers Requirements: Write a program that allows the user to input a set of desired

image text in transcribedimage text in transcribedimage text in transcribed

Please write down C++ code

E.3 Modifying an Array of Integers Requirements: Write a program that allows the user to input a set of desired real number values to store in an array, and perform operations on the array Specifications 1. 2. Declare a double-type array with size 10 in the main Create a function responsible for populating the array. This function will have a void return type and will take the double-type array and an integer-type size as parameters (code writing hints: combination of slide 23 and 17). It will contain all cout and cin statements required (shown in sample output) and will be called from the main. In a loop structure inside the function, ask the user to input 10 real numbers and store them in the passed array. No marks will be awarded for the question if an array is not used void populateArray (double array, const int size); 3. After populating the array in the populateArray function, you will create an array called arrayToDisplay of same size and data-type. Once this back up array is declared, call the displayMenu function from the main. This function will print the following options to the console for the user to select: 1. Threshold 2. Reverse 3. Print 4. Exit Ask the user to input a choice, validate that the choice is a valid menu option, and return the integer-type choice. If the input integer is invalid, keep asking for an input until a valid one is entered. You must write the displayMenu function to fit the following prototype int menuChoice 4. If the user selects option 1, a function thresholdArray will be called from the main. Inside this function, ask the user to input a threshold and set all elements of the array that are less than the threshold to 0. The function will have the following prototype void thresholdArray (double array[,double array2Dispay, const int size) where, in the parameter list, array[] is the one you have populated, array2Diplay is the one you will store the revised items 5. Option 2 will require calling the function reverseArray. This function will reverse the order of the elements in the passed parameter. This function will have the following prototype size); where, in the parameter list, array[] is the one you have populated, array2Diplay is the one void reverseArray (double array, double array2Dispay,const int you will store the revised items ES1036 Lab 3 Page 9 of 12

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_2

Step: 3

blur-text-image_3

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

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

Understanding Groups

Answered: 1 week ago