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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions