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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

// System Libraries 
#include <iostream>
#include <iomanip>
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 <<right << showpoint << division[f][e] - division[f-1][e] << endl;
			 }
		}
		  //Shows the total amount made by the division
		  for (int g = 0; g < DIV; g++)
		 {
			 for (int h = 0; h < 1; h++)
			 {
				cout << "The total sales were "  
				  << (division[h][g] + division[h+1][g] + division[h+2][g] + division[h+3][g]);
				cout << endl;
			 }
		}
		  cout << endl << endl;
		 
		  //The company's quarter sales increase and decrease.
		   for (int j = 0; j < QUA; j++)
		 {
			 cout << "The company's increase/decrease for the quarter "  << j +1 ;
			 for (int k = 0; k < 1; k++)
			 {
				cout << ((division[k][j] + division[k][j+1] + division[k][j+2] + division[k][j+3]) -
				(division[k-1][j] + division[k-1][j+1] + division[k-1][j+2] + division[k-1][j+3]));
				cout << endl;
				 
			 }
		}





	cin.ignore();
		cin.get();


	return 0;
}
Topic archived. No new replies allowed.