#include <iostream>
using namespace std;
int main()
{
string week [7] = {"Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday","Sunday"};
int Liquor_store[7];
int food_section[7];
int total_sales[7];
for(int i = 0; i<7; i++){
cout<<"Enter the sales for food section for day "<<(i+1)<<endl;
cin>>food_section[i];
cout<<"Enter the sales for Liquor store for day "<<(i+1)<<endl;
cin>>Liquor_store[i];
total_sales[i] = food_section[i] + Liquor_store[i];
}
int max=total_sales[0];
for(int i=0; i<7; i++){
if(total_sales[i]>max){
max = total_sales[i];
}
}
int min =total_sales[0];
for(int i=0; i<7; i++){
if(min > total_sales[i]){
min = total_sales[i];
}
}
int indexMax=0;
int indexMin = 0;
for(int i =0; i<7; i++){
if(total_sales[i]== max){
indexMax = i;
}
else if(total_sales[i]==min){
indexMin = i;
}
}
cout<<"A report for Management for the total sales for the week \n"<<endl;
cout << "The day with the highest sales recorded: "<<week[indexMax]<<endl;
cout << "The day with the lowest sales is: "<<week[indexMin]<<endl;
return 0;
}
Comments
Leave a comment