#include <iostream>
using namespace std;
int main()
{
  int n=7;
  int food[n];
  int liquor[n];
  Â
  cout<<"\nEnter total sales for food store: "<<endl;
  for(int i=0;i<n;i++){
    cout<<"\nEnter total sales for day "<<i+1<<": ";
    cin>>food[i];
  }
  Â
  cout<<"\nEnter total sales for liquor store: "<<endl;
  for(int i=0;i<n;i++){
    cout<<"\nEnter total sales for day "<<i+1<<": ";
    cin>>liquor[i];
  }
  int sum1=0,sum2=0;
  for(int i=0;i<n;i++){
    sum1+=food[i];
    sum2+=liquor[i];
  }
  int total=sum1+sum2;
  cout<<"\nTotal sales for this week is: "<<total<<endl;
  int maxf=food[0],maxl=liquor[0];
  int minf=food[0],minl=liquor[0];
  int ma1=0,ma2=0;
  for(int i=0;i<n;i++){
     if (food[i]>=maxf){
       maxf=food[i];
       ma1=i;
     }
     if (liquor[i]>=maxl){
       maxl=liquor[i];
       ma2=i;
     }
  }
  int mn1=0,mn2=0;
  for(int i=0;i<n;i++){
     if (food[i]<=maxf){
       maxf=food[i];
       mn1=i;
     }
     if (liquor[i]<=maxl){
       maxl=liquor[i];
       mn2=i;
     }
  }
  int ma,mn;
  if(maxf>maxl)
    ma=ma1;
  else
    ma=ma2;
  if(minf>minl)
    mn=mn1;
  else
    mn=mn2;
    Â
  cout<<"\nThe day with the highest sales is day "<<ma+1;
  cout<<"\nThe day with the lowest sales is day "<<mn+1;
  Â
  return 0;
}
Comments
Leave a comment