can you please explain to me why htese errors happen and what is the solutions for this...pleeeaaassee..:))
Problem:
Write a C++ program which will read in a list of numbers, find the average of all numbers, the average of thepositive and negative numbers, and the largest element. Your program should contain at least four functions --one to read in the list, one to write it out, one to get the averages, and one to find the largest element.
Use the following test data (there are two sets):
A) 4 -30 0 7 42 -20 18 400 -123 -6
#include<iostream>
#include<fstream>
using namespace std;
void Avgs(int Array[],int N,int& Ave,int& AveP,int& AveN){
AveP = 0;
AveN =0;
for(N=0,N<10,N++;;)
Ave=Ave+ Array[N];
Ave=Ave/10;
for(N=0,N<10,N++;;){
if (Array[N]>= 0)
AveP= AveP+Array[N];
else
AveN= AveN+Array[N];
}
AveP= AveP/6;
AveN= AveN/4;
}
int Large(int Array[],int N, int& Big);{
int Big = 0
for(N=0,N<10,N++;){
if (Array[N] > Big)
Big= Array[N]}
return Big
}
void Display(int Array[],int N, int AveP,int AveN,int Max){
for(N=0,N<10,N++;;)
int Big = Max;
cout<<Array[N]<<endl;
cout<<"The Average of the Positive Numbers is:"<<AveP<<endl;
cout<<"The Average of the Negative Numbers is:"<<AveN<<endl;
cout <<"The Biggest Integer is:"<<Max<<endl;
}
void Readlist(int Array[],int N){
ifstream fin;
fin.open("Input.txt");
for(N=0,N<10,N++;;)
fin>>Array[N];
fin. close();
}
int main() {
int A,B,C,D,E,F,G,H,I,J,K,Array[10];
Readlist(Array[10],A);
Avgs(Array[10],B,C,D,E);
Large(Array[10],F,G);
Display(Array[10],H,I,J,K);
return 0;
}