Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a complete C + + program with a f unction called arrayFun that takes an 1 D integer array of user - specified size

Write a complete C++ program with a f
unction called arrayFun that takes an 1D integer array of
user-specified size and finds the sum,
average, and largest and smallest of the numbers stored in the array.
Create an integer array and initialize it to random integers in the main f
unction.
Pass this array to arrayFun and print the results of the arrayFun operations to the monitor.
Example main f
unction that uses arrayFun:
int main(){
int size;
cout << "How many numbers to enter? ";
cin >> size;
int nums[size];
cout << "Enter numbers: ";
for(int i =0; i < size; i++){
cin >> nums[i];
}
arrayFun(nums, size); // prints sum, average, largest and smallest of elements in nums
return 0;
}

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

Be familiar with the different perspectives of service quality.

Answered: 1 week ago

Question

Describe key customer feedback collection tools.

Answered: 1 week ago

Question

Know what customers expect from the firm when they complain.

Answered: 1 week ago