I am doing a problem that asks me to write a program that uses a structure named CorpData to store the following information on a company division and it asks me to store various sales numbers and division names such as east, west, south, or north.
It then asks me to include a constructor that allows the division name and four quarterly sales amounts to be specified at the time a CorpData variable is created.
The program should create four variables of the structure each representing one of the division. Each variable should be passed in turn to a function that calculates and stores the total sales and average quarterly sales for that division. Once this has been done for each division, each variable should be passed in turn to a function that displays the division name, total sales, and quarterly average
I cant figure out how I can get the sales numbers in the right division. This is what I have so far. Any help would be very welcome.
Code:
#include <iostream>
#include <string>
using namespace std;
struct CorpData
{
string name
double firstsales,
secondsales,
thirdsales,
fourthsales,
annualsales,
averagesales;
CorpData()
{ east = "";
west = "";
north = "";
south = "";
}
};
int main()
{
CorpData east,west,north,south;
cout << "Enter the division name: ";
cin >> ;
return 0;
}