Question
please complete carefully and fully in c++ A corporation has three divisions, each responsible for sales to different geographical locations. Write a program using two
please complete carefully and fully in c++
A corporation has three divisions, each responsible for sales to different geographical locations. Write a program using two classes which produce the sales and expenses data for each division, and in total.(Revised) You must use "collaboration" or "collaboration with aggregation" to produce the results. There will be two classes in this program: 1) class DivExpenses_C, which has a variable to hold a division's annual expenses, plus constructors and member functions Set_Expenses and Get_Expenses. 2) class DivSales_C, with the following members: -a DivExpenses_C object (if using aggregation). -an array with four elements for holding four quarters of sales figures for the division -a private static variable for holding the total corporate sales for all divisions for the entire year. -a default constructor, and a constructor which accepts four quarters of sales figures which will be stored in the member array -a member function (setter) which accepts four quarters of sales figures and adds them to the existing four sales in the member array. -a member function which takes an integer argument within the range of 0-3. This argument is to be used as a subscript into the division quarterly sales array. The function should return the value of the array element with that subscript. -other appropriate getter and setter member functions for the two member variables -an additional member function, named Get_Expenses, which will accept a DivExpenses_C object as an argument in order to access the object's annual expenses (collaboration). In main, create arrays of size three for both DivSales_C and DivExpenses_C objects (three divisions) using default constructors. There will be two functions in the program: 1) the user will fill the array containing the three DivSales_C objects with four quarters of sales figures for each division (see data below) 2) the user will fill the array containing the three DivExpenses_C objects with an annual expense figure for each division (see data below) remember: add sales to the static variable whenever sales are posted to a division After the sales and expenses are entered in the appropriate functions, the program should display in main a table showing each division's four quarterly sales as-well-as its annual expenses, and show overall grand total sales, grand total expenses, and net sales (note: you must use the DivSales_C member function Get_Expenses whenever retrieving each division's expenses; and must use the static variable whenever retrieving grand total sales). Enter the following sales (4 quarters for each division): Division 1-$10,000; $30,000; $20,000; $50,000 Division 2-$25,000; $10,000; $35,000; $40,000 Division 3-$60,000; $45,000; $10,000; $15,000 Enter the following Expenses: Division 1-$100,000 Division 2-$100,000
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started