Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here Im posting my code but as you can see theres a unhandled exception at the setValues funtion (third picture) if someone can help me

Here Im posting my code but as you can see theres a unhandled exception at the setValues funtion (third picture) if someone can help me i would appreciate it image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
I/ write the required preprocessor directives =includeciostreams Hincludeccstdlib) uincludecctime? using nanespace std; void setvalues(int array[], int size);. If this method receives an integer array and its size as paraneters int addValues(int array[], int size); 1/ this method receives an integer array and its size as parameters int highest(int array[], int size); // this nethod receives an integer array and its size as parameters int lowest(int array[], int size); /l this method receives an integer array and its size as parameters float average(int array[], int size): // this inethod receives an integer array and its size as parameters void printvalues(int array[], int size); II this method receives an integer array and its size as parameters void personalinfo(); =1 Gint main() ( If declare an integer constant named SIzE and initialize to 7 const int SIZE =7; If declare an intger array named values using the constant as the size 1/ and initialize all eleisents to 8 int values[SIzE] ={6} f: If call the printValues method printYaluesfualues stzE). const int stzt =7; If declare an intger array naned values using the constant as the size 1/ and initialize all elenents to 8. int values [ SI2E ]={}; 1/ call the printvalues method printvalues(values, size); /I call the setvalues method to populate the array setvelues (values, size); If call the printvalues nethod printvalues(values, sIzE); II print the phease "The sum of the values in the array is [suin], the highest value is 11. [High], the highest value is, and the average of a 11 values is [average]. f/ Call the appropriate functions to obtain the sum, highest, lowest, and average values. Int. sun = addvalues (values, 5tzt); int high = highest(values, SIZE): int low = lowest (values, 51ZE): float avg - average(values, SIZE); cout si "The sum of the values in the array is" s sum ks ", the highest value is" \& high e ", the highest value is" ce low \&s ", and the average of all values is" co avg cal." Ql/ The setValues method receives an integer array and its size as paraineters and has no If return value. If uses the pseudo random number generator function to assign a value 1/ between 1 and 100 to every element of the array. Make sure to seed the pseudo random If number generator before calling the rand function. The only variable declared in this If method is the counter used in the for iteration control structure. void setvalues(int array[], int size) {. srand(tine(NULL)); for (int 1=0;1 high) \{ high = array [i]; 3 ? If The lowest method receives an integer array and its size as parameters and returns If an integer value. Declare the local integer variable low and initialize it to the 1/ value of the first element of the array. The method implements a for iteration control 1/ structure to find out the lowest of ali. values in the array, and returns such value. int lovest(int array[], int size) \{ int low = array []; b1 for (Int 1=1;1 low) \{ low = array [1]; return low; E/f The average method receives an integer array and its size as parameters and returns If a float value. Declare the local float variable suma and initialize it to 0. If The method implements a for iteration control structure to add all values in the array 1/ and returns the average. float average(int array[], int size) \{ float sum =; for ( int i=;i

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 Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

What is a tracking study and how is it used? A test market?

Answered: 1 week ago

Question

3.4 Define HRIS and describe its main components.

Answered: 1 week ago