Stationery Ordering System

Please help me with this group assignment which I have to pass up on 8th July.

I tried to get this work, but it always have errors.
The question is form here: http://sdrv.ms/16292hI

This code needs to save data from choice 'a' in order to select choice 'b' in the main menu.

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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
// Stationery Ordering System.cpp : How much sales Writers Depot get for selling stationery.
//

/*
ICT1101 ASSIGNMENT 2 - GROUP
C++ code
*/


#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main ()
{
	// output variables

	float SaleBP, SaleNB, SaleFD, SalePL;			// Sale amount of Blue pen 1.0 point, One inch thick notebook, Two-pocket plastic folder, and 200-pages blank planner respectively.
	float PaidBP, PaidNB, PaidFD, PaidPL;			// Paid amount of Blue pen 1.0 point, One inch thick notebook, Two-pocket plastic folder, and 200-pages blank planner respectively.
	float UnpaidBP, UnpaidNB, UnpaidFD, UnpaidPL; 	// Unpaid amount of Blue pen 1.0 point, One inch thick notebook, Two-pocket plastic folder, and 200-pages blank planner respectively.
	float TotalPaid; 	// 	Total paid amount.
	float TotalUnpaid; 	// 	Total unpaid amount.
	float NetProfit; 	// 	Net profit gained.
	
		// When ordering
		float TotalSales; // Total sales of all items ordered.
	
	// process variables
	float Discount;		// Discount per order.
	float npBluePen, npNotebook, npFolder, npPlanner;	// Net profit of Blue pen 1.0 point, One inch thick notebook, Two-pocket plastic folder, and 200-pages blank planner respectively.
	
	// input variables
	char Option; 		// Choosing an option.
	int Item = 1;		// Chossing an item.
	int BluePen;		// Quantity of Blue pen 1.0 point.
	int Notebook;		// Quantity of One inch thick notebook.
	int Folder;			// Quantity of Two-pocket plastic folder.
	int Planner;		// Quantity of 200-pages blank planner.
	
	// input
	cout<< "Welcome to Writers Depot's Stationery Ordering System. Choose an option: \n" ;
	cout<< "a.	Enter order details \n" ;
	cout<< "b.	Display monthly report \n" ;
	cout<< "c.	Exit the system \n" ;
	
	cout<< "Your option: " ;
	cin>> Option ;
	
	switch (Option)
	{
	case 'a': case 'A':
		// Ordering menu
		cout<< "------------------------MENU------------------------ \n" ;
		cout<< "	ITEM						  COST PER UNIT \n" ;
		cout<< "1. 	Blue pen 1.0 point					RM 0.20 \n" ;
		cout<< "2.	One inch thick notebook					RM 2.50 \n" ;
		cout<< "3.	Two-pocket plastic folder				RM 0.50 \n" ;
		cout<< "4.	200-pages blank planner					RM 2.50 \n" ;
		cout<<endl;
		cout<< "Choose '0' to calculate the total price of all the items. \n" ;
		
		cout<< "Choose an item: " ;
		cin>> ItemOption ;
		
		switch (ItemOption)
		{
		case 1:
			// Enter quantity of Blue pen 1.0 point
			
			cout<< "You choose to buy Blue pen 1.0 point. \n" ;
			cout<< "How many units you want to buy? \n" ;
			cout<< "Quantity: " ;
			cin>> BluePen ;
			
			if (1 <= BluePen && BluePen <= 500)
			{
				Discount = 0.10;
			}
			else if (501 <= BluePen && BluePen <= 1000)
			{
				Discount = 0.20;
			}
			else if (1001 <= BluePen && BluePen <= 2000)
			{
				Discount = 0.35;
			}
			else
			{
				Discount = 0.50;
			}

			SaleBP = 0.20 * BluePen * Discount;
			npBluePen = 0.50 * SaleBP;
			
			cout<< "Current price: RM " << SaleBP <<endl;
			
			break;
		

		case 2:
			// Enter quantity of One inch thick notebook

			cout<< "You choose to buy One inch thick notebook. \n" ;
			cout<< "How many units you want to buy? \n" ;
			cout<< "Quantity: " ;
			cin>> Notebook ;

			if (1 <= Notebook && Notebook <= 500)
			{
				Discount = 0.10;
			}
			else if (501 <= Notebook && Notebook <= 1000)
			{
				Discount = 0.20;
			}
			else if (1001 <= Notebook && Notebook <= 2000)
			{
				Discount = 0.35;
			}
			else
			{
				Discount = 0.50;
			}

			SaleNB = 2.50 * Notebook * Discount;
			npNotebook = 0.40 * SaleNB;
			
			cout<< "Current price: RM " << SaleNB <<endl;
			
			break;
		

		case 3:
			// Enter quantity of Two-pocket plastic folder

			cout<< "You choose to buy Two-pocket plastic folder. \n" ;
			cout<< "How many units you want to buy? \n" ;
			cout<< "Quantity: " ;
			cin>> Folder ;

			if (1 <= Notebook && Notebook <= 500)
			{
				Discount = 0.10;
			}
			else if (501 <= Notebook && Notebook <= 1000)
			{
				Discount = 0.20;
			}
			else if (1001 <= Notebook && Notebook <= 2000)
			{
				Discount = 0.35;
			}
			else
			{
				Discount = 0.50;
			}	

			SaleFD = 0.50 * Folder * Discount;
			npFolder = 0.60 * SaleFD;
			
			cout<< "Current price: RM " << SaleFD <<endl;
			
			break;
		

		case 4:
		
			// Enter quantity of 200-pages blank planner

			cout<< "You choose to buy 200-pages blank planner. \n" ;
			cout<< "How many units you want to buy? \n" ;
			cout<< "Quantity: " ;
			cin>> Planner ;

			if (1 <= Planner && Planner <= 500)
			{
				Discount = 0.10;
			}
			else if (501 <= Planner && Planner <= 1000)
			{
				Discount = 0.20;
			}
			else if (1001 <= Planner && Planner <= 2000)
			{
				Discount = 0.35;
			}
			else
			{
				Discount = 0.50;
			}

			SalePL = 2.50 * Planner * Discount;
			npPlanner = 0.50 * SalePL;
			
			cout<< "Current price: RM " << SalePL <<endl;
			break;
		
		case 0:
			TotalSales = SaleBP + SaleNB + SaleFD + SalePL;
			
			break;
			
			
		default:
			// Item not in our menu
			cout<< "Sorry, no item option in the system. Please select again."<<endl;
		
		}
		break;

	case 'b': case 'B':
	
		// process
		TotalPaid = PaidBP + PaidNB + PaidFD + PaidPL ; // Total paid amount.
		TotalUnpaid = UnpaidBP + UnpaidNB + UnpaidFD + UnpaidPL ; // Total unpaid amount.
		NetProfit = npBluePen + npNotebook + npFolder + npPlanner ; // Total net profit.


		// output
		cout<< "a.	Total quantity ordered for each item:" <<endl;
		cout<< "	Blue pen 1.0 point			: "<< BluePen <<endl;
		cout<< "	One inch thick notebook		: "<< Notebook <<endl;
		cout<< "	Two-pocket plastic folder	: "<< Folder <<endl;
		cout<< "	200-pages blank planner		: "<< Planner <<endl<<endl;


		cout<< "b.	Sale amount for each item:" <<endl;
		cout<< "	Blue pen 1.0 point			: "<< SaleBP <<endl;
		cout<< "	One inch thick notebook		: "<< SaleNB <<endl;
		cout<< "	Two-pocket plastic folder	: "<< SaleFD <<endl;
		cout<< "	200-pages blank planner		: "<< SalePL <<endl<<endl;


		cout<< "c.	Paid amount for each item:" <<endl;
		cout<< "	Blue pen 1.0 point			: "<< PaidBP <<endl;
		cout<< "	One inch thick notebook		: "<< PaidNB <<endl;
		cout<< "	Two-pocket plastic folder	: "<< PaidFD <<endl;
		cout<< "	200-pages blank planner		: "<< PaidPL <<endl<<endl;


		cout<< "d.	Unpaid amount for each item:" <<endl;
		cout<< "	Blue pen 1.0 point			: "<< UnpaidBP <<endl;
		cout<< "	One inch thick notebook		: "<< UnpaidNB <<endl;
		cout<< "	Two-pocket plastic folder	: "<< UnpaidFD <<endl;
		cout<< "	200-pages blank planner		: "<< UnpaidPL <<endl<<endl;		


		cout<< "e.	Total paid amount: "<< TotalPaid <<endl;
		cout<< "f.	Total unpaid amount: "<< TotalUnpaid <<endl;
		cout<< "g.	Net profit gained: "<< NetProfit <<endl;
	
	break;

	case 'c': case 'C':

	break;

	default:

	;

	}
	
	return 0;
}
There wan no "ItemOption" in your program but in line 66 you asked for it , I think you meant Item ;
Inl lines 29 and 202 you define a variable "TotalSales" and calculate it but you never printed it to output ; I mean you didn't use it at all .
And the most important problem in your program is that it doesn't loop at all , I mean your program closes anfter the first choice of the user .

By the way the answer you are looking for :
It is bette to define four other variables (maybe float or double) for 4 items , and initialize them to 0 at the start of the program ;
Everytime a costumer buys something you can "+=" it to the current order price .
So everytime someone buys something , It's price adds to the total price of the previous result .

The places I put an star are the places I changed :

The places I put an star are the places I changed :
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main ()
{
	// output variables

	float SaleBP, SaleNB, SaleFD, SalePL;			
	float PaidBP, PaidNB, PaidFD, PaidPL;			
	float UnpaidBP, UnpaidNB, UnpaidFD, UnpaidPL; 	
	float SumBP (0) , SumNB (0) , SumFD (0) , SumPL (0) ; //*************************************
	int QSumBP (0) , QSumNB (0) , QSumFD (0) , QSumPL (0) ; //***********************
	float TotalPaid; 	// 	Total paid amount.
	float TotalUnpaid; 	// 	Total unpaid amount.
	float NetProfit; 	// 	Net profit gained.

		// When ordering
		float TotalSales; // Total sales of all items ordered.

	// process variables
	float Discount;		// Discount per order.
	float npBluePen, npNotebook, npFolder, npPlanner;	// Net profit of Blue pen 1.0 point, One inch thick notebook, Two-pocket plastic folder, and 200-pages blank planner respectively.

	// input variables
	char Option; 		// Choosing an option.
	int Item = 1;		// Chossing an item.
	int BluePen;		// Quantity of Blue pen 1.0 point.
	int Notebook;		// Quantity of One inch thick notebook.
	int Folder;			// Quantity of Two-pocket plastic folder.
	int Planner;		// Quantity of 200-pages blank planner.

	// input
	cout<< "Welcome to Writers Depot's Stationery Ordering System. Choose an option: \n" ;
	cout<< "a.	Enter order details \n" ;
	cout<< "b.	Display monthly report \n" ;
	cout<< "c.	Exit the system \n" ;

	cout<< "Your option: " ;
	cin>> Option ;
while (Option != 'c') //************************************************
{                       //*************************************
	switch (Option)
	{
	case 'a': case 'A':
		// Ordering menu
		cout<< "------------------------MENU------------------------ \n" ;
		cout<< "	ITEM						  COST PER UNIT \n" ;
		cout<< "1. 	Blue pen 1.0 point					RM 0.20 \n" ;
		cout<< "2.	One inch thick notebook					RM 2.50 \n" ;
		cout<< "3.	Two-pocket plastic folder				RM 0.50 \n" ;
		cout<< "4.	200-pages blank planner					RM 2.50 \n" ;
		cout<<endl;
		cout<< "Choose '0' to calculate the total price of all the items. \n" ;

		cout<< "Choose an item: " ;
		cin>> Item ;

		switch (Item)
		{
		case 1:
			// Enter quantity of Blue pen 1.0 point

			cout<< "You choose to buy Blue pen 1.0 point. \n" ;
			cout<< "How many units you want to buy? \n" ;
			cout<< "Quantity: " ;
			cin>> BluePen ;

			if (1 <= BluePen && BluePen <= 500)
			{
				Discount = 0.10;
			}
			else if (501 <= BluePen && BluePen <= 1000)
			{
				Discount = 0.20;
			}
			else if (1001 <= BluePen && BluePen <= 2000)
			{
				Discount = 0.35;
			}
			else
			{
				Discount = 0.50;
			}

			SaleBP = 0.20 * BluePen * Discount;
			npBluePen = 0.50 * SaleBP;
			SumBP += SaleBP ; //*************************************
			QSumBP += BluePen ; //******************************
			
			cout<< "Current price: RM " << SaleBP <<endl;

			break;


		case 2:
			// Enter quantity of One inch thick notebook

			cout<< "You choose to buy One inch thick notebook. \n" ;
			cout<< "How many units you want to buy? \n" ;
			cout<< "Quantity: " ;
			cin>> Notebook ;

			if (1 <= Notebook && Notebook <= 500)
			{
				Discount = 0.10;
			}
			else if (501 <= Notebook && Notebook <= 1000)
			{
				Discount = 0.20;
			}
			else if (1001 <= Notebook && Notebook <= 2000)
			{
				Discount = 0.35;
			}
			else
			{
				Discount = 0.50;
			}

			SaleNB = 2.50 * Notebook * Discount;
			npNotebook = 0.40 * SaleNB;
			SumNB += SaleNB ; //****************************************************
            QSumNB += Notebook ; //***************************

			cout<< "Current price: RM " << SaleNB <<endl;

			break;


		case 3:
			// Enter quantity of Two-pocket plastic folder

			cout<< "You choose to buy Two-pocket plastic folder. \n" ;
			cout<< "How many units you want to buy? \n" ;
			cout<< "Quantity: " ;
			cin>> Folder ;

			if (1 <= Notebook && Notebook <= 500)
			{
				Discount = 0.10;
			}
			else if (501 <= Notebook && Notebook <= 1000)
			{
				Discount = 0.20;
			}
			else if (1001 <= Notebook && Notebook <= 2000)
			{
				Discount = 0.35;
			}
			else
			{
				Discount = 0.50;
			}

			SaleFD = 0.50 * Folder * Discount;
			npFolder = 0.60 * SaleFD;
			SumFD += SaleFD ; //******************************************
			QSumFD += Folder ; //*********************************

			cout<< "Current price: RM " << SaleFD <<endl;

			break;


		case 4:

			// Enter quantity of 200-pages blank planner

			cout<< "You choose to buy 200-pages blank planner. \n" ;
			cout<< "How many units you want to buy? \n" ;
			cout<< "Quantity: " ;
			cin>> Planner ;

			if (1 <= Planner && Planner <= 500)
			{
				Discount = 0.10;
			}
			else if (501 <= Planner && Planner <= 1000)
			{
				Discount = 0.20;
			}
			else if (1001 <= Planner && Planner <= 2000)
			{
				Discount = 0.35;
			}
			else
			{
				Discount = 0.50;
			}

			SalePL = 2.50 * Planner * Discount;
			npPlanner = 0.50 * SalePL;
			SumPL += SalePL ;  //*************************************************
			QSumPL += Planner ; //*********************************

			cout<< "Current price: RM " << SalePL <<endl;
			break;

		case 0:
			TotalSales = SaleBP + SaleNB + SaleFD + SalePL;
			cout << TotalSales ;

			break;


		default:
			// Item not in our menu
			cout<< "Sorry, no item option in the system. Please select again."<<endl;

		}
		break;

	case 'b': case 'B':

		// process
		TotalPaid = SumBP + SumNB + SumFD + SumPL ; // Total paid amount.  ***************************************
		TotalUnpaid = UnpaidBP + UnpaidNB + UnpaidFD + UnpaidPL ; // Total unpaid amount.
		NetProfit = npBluePen + npNotebook + npFolder + npPlanner ; // Total net profit.


		// output
		cout<< "a.	Total quantity ordered for each item:" <<endl;
		cout<< "	Blue pen 1.0 point			: "<< QSumBP <<endl;  //******************************************
		cout<< "	One inch thick notebook		: "<< QSumNP <<endl;  //********************************************
		cout<< "	Two-pocket plastic folder	: "<< QSumFD <<endl;  //********************************************
		cout<< "	200-pages blank planner		: "<< QSumPL <<endl<<endl;  //***************************************


		cout<< "b.	Sale amount for each item:" <<endl;
		cout<< "	Blue pen 1.0 point			: "<< SaleBP <<endl;
		cout<< "	One inch thick notebook		: "<< SaleNB <<endl;
		cout<< "	Two-pocket plastic folder	: "<< SaleFD <<endl;
		cout<< "	200-pages blank planner		: "<< SalePL <<endl<<endl;


		cout<< "c.	Paid amount for each item:" <<endl;
		cout<< "	Blue pen 1.0 point			: "<< PaidBP <<endl;
		cout<< "	One inch thick notebook		: "<< PaidNB <<endl;
		cout<< "	Two-pocket plastic folder	: "<< PaidFD <<endl;
		cout<< "	200-pages blank planner		: "<< PaidPL <<endl<<endl;


		cout<< "d.	Unpaid amount for each item:" <<endl;
		cout<< "	Blue pen 1.0 point			: "<< UnpaidBP <<endl;
		cout<< "	One inch thick notebook		: "<< UnpaidNB <<endl;
		cout<< "	Two-pocket plastic folder	: "<< UnpaidFD <<endl;
		cout<< "	200-pages blank planner		: "<< UnpaidPL <<endl<<endl;


		cout<< "e.	Total paid amount: "<< TotalPaid <<endl;
		cout<< "f.	Total unpaid amount: "<< TotalUnpaid <<endl;
		cout<< "g.	Net profit gained: "<< NetProfit <<endl;

	break;

	default:

	;

	}
	cout<< "\n\n\nChoose an option: \n" ; //****************************************
	cout<< "a.	Enter order details \n" ;
	cout<< "b.	Display monthly report \n" ;
	cout<< "c.	Exit the system \n" ;

	cout<< "Your option: " ;
	cin>> Option ; //*******************************************************
    }                //***************************************

	return 0;
}

Just a style + organisation point :

Have each of your cases call a function - this will make the code much easier to read.

There is a bit of an idea that functions should not be more than 80 LOC - some go for even less 20 or 30 say. So your main at 268 LOC is way too much.

HTH
By the way there are other little errors in your program and I erased that stdafx.h at the start of the program , you didn't need that .
And I didn't fix the whole part , You can see what I did and fix other parts .
Sorry if my English is terrible , and let me know if you needed more explainationa.
The second part needs to be required. How?

All items are packed in a package of 100 units each. The system should be able to reject any quantity that are not ordered in multiple of hundred. It should then ask for another quantity. This process continues until the user enters a correct quantity.
it should be something like this I think :
1
2
3
cin >> Bluepen ;
while (Bluepen % 100 != 0)
     cin >> Bluepen ;
Topic archived. No new replies allowed.