in Coral Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the average and max. A negative integer ends the input and is not included in the statistics. Ex: When the input is: 15 20 0 5 -1 the output is: 10 20 Assume that at least one non-negative integer is input.

Respuesta :

The program that describes using any number of non-negative integers as input, and outputs the average and max is; As written below

How to Solve Programming Problems?

#include <bits/stdc++.h>

#include<vector>

using namespace std;

/*

Statistics are often calculated with varying amounts of input data.

Write a program that takes any number of non-negative integers as input, and outputs the max and average.

A negative integer ends the input and is not included in the statistics.

Assume the input contains at least one non-negative integer.

Output each floating-point value with two digits after the decimal point,

which can be achieved by executing cout << fixed << setprecision(2); once before all other cout statements.

*/

int main()

{

float c=0,temp=0,Max=0,Avg=0;

c=0;

cout<<"\n\eEnter Values separated by space: ";

while(temp>=0)

{

 cin>>temp;

 if(temp>=0)

 {

  Avg = Avg + temp;

  if(Max<=temp) Max = temp;  

  c++;

 }

}

Avg = Avg/c;

cout<<"\n\tMax. Value = "<<fixed<<setprecision(2)<<Max;

cout<<"\n\tAverage    = "<<fixed<<setprecision(2)<<Avg;

return(0);

}

Read more about Programming at; https://brainly.com/question/23275071

#SPJ1

A program that takes any number of non-negative integers as input, and outputs the average and max is import java. util.Scanner;

What is input data?

Any statistics this is furnished to a pc or a software program application is referred to as enter. Since the statistics furnished is likewise taken into consideration to be information, the method of supplying statistics to the pc is likewise referred to as information enter. The enter allows the pc to do what's designed to do and convey an output.

  1. import java.util.Scanner;
  2. public elegance LabProgram
  3. } while (num >= 0); avg = total/(count-1);
  4. System.out.println(avg + " " + max):
  5. }

Read more about the Coral Statistics:

https://brainly.com/question/24796463

#SPJ1