Write a program that uses a structure to store the following information on a company division:
Division name (East and West)
Quarter (1, 2, 3, 4)
Quarterly Sales
Total corporate sales for each quarter
Total corporate sales for each division
Total yearly corporate sales
** I do not think that I am defining the variables correctly like (east.firstQtr) in the called functions. How and where should I define those kinds of variables?
void compdiv::set_qtr_sales()
{
cout<<"Please enter the sales for first quarter: ";
cin>>first_qtr;
cout<<"Please enter sales for second qtr: ";
cin>>second_qtr;
cout<<"Please enter sales for third qtr: ";
cin>>third_qtr;
cout<<"Please enter sales for fourth qtr: ";
cin>>fourth_qtr;
cout<<endl;
}
cout<<"Enter details for division east:\n";
east.set_qtr_sales();
cout<<"Enter details for division west:\n";
west.set_qtr_sales();
cout<<"Total sales for the first quarter: "<<east.first_qtr_sales()+west.first_qtr_sales()<<endl;
cout<<"Total sales for the second quarter: "<<east.second_qtr_sales()+west.second_qtr_sales()<<endl;
cout<<"Total sales for the third quarter: "<<east.third_qtr_sales()+west.third_qtr_sales()<<endl;
cout<<"Total sales for the fourth quarter: "<<east.fourth_qtr_sales()+west.fourth_qtr_sales()<<endl;
cout<<"Total sale for the east divison: "<<east.get_total_div_sales()<<endl;
cout<<"Total sales for the west division: "<<west.get_total_div_sales()<<endl;
I tried calling them the very first thing before i defined the structure. We're not supposed to use a class so I am trying to do it by calling the functions.