### Loop problem

I'm doing some review for class but I ran into a problem on the last for loop. It is supposed to find the difference between the sales quarters. Quarter 1 to Quarter 2 to Quarter 2 to 3 and 3 to 4 the company lost or made this much money. I'm not sure what I am doing wrong because I get something that looks like scientific notation.

 ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394`` `````` // System Libraries #include #include using namespace std; const int DIV = 6; const int QUA = 4; int main() { float salesAmount; float division[QUA][DIV]; cout << "Enter the sales for the following Divisions for the quarter. " << endl; cout << endl << endl; // This part of the program has the user enter data for ( int d = 0; d < DIV; d++) { for( int q = 0; q < QUA; q++) { cout << "Please enter the quarterly sales for Division: " << d +1 << " Quarter: " << q + 1 ; cout << endl << "\$ " ; cin >> division[q][d]; if (division[q][d] < 0) { cout << "That is not a valid number. Try again." << endl; cin >> division[q][d]; } } } cout << endl << endl; // This part displays the information entered for (int a = 0; a < DIV; a++) { cout << "The quarterly sales for Division were " << a +1 << endl; for (int b = 0; b < QUA; b++) { cout << "\$ " ; cout << division[b][a] << endl; } } cout << endl << endl; // This part calculated the increase and decrease for the quarters of each division for (int e = 0; e < DIV; e++) { cout << "The quarterly sales increase/decrease for Division were " << e +1 << endl << endl; for (int f = 1; f < QUA; f++) { cout << "Quarter: " << f << " to Quarter: " << f+1 << endl; cout << "\$ " ; cout <
Topic archived. No new replies allowed.