Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ --- only do question 2, but you have to see question 1 to do question 2 Question 1 Consider the following code segment: int

C++ --- only do question 2, but you have to see question 1 to do question 2image text in transcribed

Question 1 Consider the following code segment: int main() cons int SIZE = 20; int values [SIZE] - (0, 23, 34, -7, 110, 42, -350, 424, 25, 99, 10, 05, 50, -5, 1, 200, 350, 437, 25, 147; // your code goes here Write a complete program to display the values from each of the following four steps. All displays must be done in main. Use separate functions for each step below, passing the array to each function 1.1) Provide the sum of the numbers in this array -function must return an int. 1.2) Provide the average of the positive numbers in this array - function must return a double. 1.3) Provide the lowest number in the array function must return an int. 1.4) Povide the highest number in the array -function must return an int. Question.2 Re-do question 1 using vectors rather than arrays. The same testcases should be used

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

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions