Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Extend the program below so that it also calculates the average of all numbers between 18 and 30. Use a separate loop. Try as well

Extend the program below so that it also calculates the average of all numbers between 18 and 30. Use a separate loop. Try as well to: 1) Use functions 2) make the program flexible enough to compute the average of values within any other range.
Code: #include  using namespace std; void readData(int, *data, int sz){ } int main(){ //set size of array and create it int sz = 0; int arr[sz]; cout<<"enter num data: "<>sz; int *data = new int[sz]; //int data[5]; cout<<"Data is "<>data[i]; } //loop 2:calculate the average int sum = 0; for (int i=0; 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

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

Conduct a needs assessment. page 283

Answered: 1 week ago

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago

Question

How would you assess the value of an approach like this?

Answered: 1 week ago

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago

Question

3. How would this philosophy fit in your organization?

Answered: 1 week ago