Question: This C++ program will use a structure to hold the data for each division of a corporation. The structure will keep the following data: Name
This C++ program will use a structure to hold the data for each division of a corporation.
The structure will keep the following data:
Name of division (string)
Sales total for quarter 1 (double)
Sales total for quarter 2 (double)
Sales total for quarter 3 (double)
Sales total for quarter 4 (double)
The program will ask the user for the inputs needed to populate the structure. Then display the data for each instance of the structure.
Complete the code below to complete the program and provide a /*multi-line psedudocode*/ for the program.
#include#include #include using namespace std; struct Division { }; void GetDivisionSales(Division& div); void DisplayDivision(Division div); int main() { Division east, west, north, south; east.name = "East"; west.name = "West"; north.name = "North"; south.name = "South"; GetDivisionSales(east); GetDivisionSales(west); GetDivisionSales(north); GetDivisionSales(south); DisplayDivision(east); DisplayDivision(west); DisplayDivision(north); DisplayDivision(south); return 0; } void GetDivisionSales(Division& div) { } void DisplayDivision(Division div) { cout << "Sales amount for " << div.name << "Division" << endl; cout << setw(20) << div.quarter1 << endl; cout << setw(20) << div.quarter2 << endl; cout << setw(20) << div.quarter3 << endl; cout << setw(20) << div.quarter4 << endl; cout << "Total Sales " << div.quarter1 + div.quarter2 + div.quarter3 + div.quarter4 << endl; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
