Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ Write a function named isum that takes two arguments - an int array named x, followed by an int named n - and

In C++ Write a function named isum that takes two arguments - an int array named x, followed by an int named n - and returns an int value that is the sum of the first n elements in x. Example function prototype here:

int isum(int x[], int n); 

also Write another function named avg that takes two arguments - an int array named x, followed by an int named n - and returns a double value equal to the average (arithmetic mean) of the first n elements in x. Example function prototype here:

double avg(int x[], int n); 

Must be able to be put within this program skeleton:image text in transcribed

Sample output:image text in transcribed

#include using namespace std; // prototypes of functions to be pasted below main int isum(int x[], int n); double avg(int x[], int n); int main) i const int MAXN 100; int a[MAXN], input; double average, diff; // fill array with data from user, and count items cout > input; while cin.good() && n > input; SET average TO AVERAGE VALUE OF FIRST n ELEMENTS OF a */ /* print summary results and header for diffs */ cout

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

=+1.5. 1 The Cantor set C can be defined as the closure of A3(1).

Answered: 1 week ago