#include<iostream.h>
void main(void)
{
int paint[11],
j,
total,
average,
max,min,
less_50,
greater_50,
min_50=0,
max_50=0,
for(j=1;j<=10;j++)
{
cout<<"Enter the cases of paint ";
cin>>paint[j];
}
max=paint[0];
for(j=0;j<90;j++)
{
max=paint[1];
for(j=1;j<=10;j++)
{
if(paint[j]>max)
max=paint[j];
}
min=paint[1];
for(j=1;j<=10;jtt)
{
if(paint[j]<min)
min=paint[j];
}
max_50=0
for(j=1;j<=10;j++)
{
if(paint[j]>50)
greater_50++;
}
min_50=0;
for(j=1;j<=10;j++)
{
if(paint[j]<50)
less_50++;
}
total=0;
for(j=1;j<=10;j++)
{
total=total+paint[j];
average=total/10;
}
cout<<"The Average number of paint cases sold per day "<<average<<endl;
cout<<"The Maximum number of paint cases sold per day "<<max<<endl;
cout<<"The Minimum number of paint cases sold perday "<<min<<endl;
cout<<"Number of days that paint sales were greater than 50 are "<<greater_50<<endl;
cout<<"Number of days that paint sales were less than 50 are "<<less_50<<endl;
}
When I run this it compiles but I get negative numbers for the Number of days that paint sales were greaterthan 50 and also the next line. Now I have been told to make sure to zero things out before file name but am not sure about what they want me to do. Could some one help Please I have worked on this for awhile and am afraid I have looked to much it has to be right in front of me. C++visual basic 6.0



LinkBack URL
About LinkBacks


