can someone please help me understand why totaldivsales, average, and at the bottom, total yearly corporate sales, show up in scientific notation instead of values?
CL2 Declare each variable with the smallest possible scope and initialize it at the same time.
This quote is found in CERN's C++ Coding standard which can be easily googled. I find it a very useful guide to keep my code readable and less prone to common errors while I learn.
Different organizations have different standards which mostly vary according to style. CERN's was the first one I found and it's quite readable and short, which is why I try to use it.
On line 83 array index is out of bounds (array indexes start at 0) so it should be cout << "Total Yearly Corporate Sales: " << division[3].totalDivSales << endl; but I think that's not what you want - you wan to display sum of all comDiv::totalDivSales, right?