-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathproduct.html
262 lines (237 loc) · 9.39 KB
/
product.html
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
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 11">
<meta name=Originator content="Microsoft Word 11">
<link rel=File-List href="2.2.product_files/filelist.xml">
<title>DSA - Assignment 2</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>User</o:Author>
<o:LastAuthor>User</o:LastAuthor>
<o:Revision>2</o:Revision>
<o:TotalTime>1</o:TotalTime>
<o:Created>2013-11-01T09:47:00Z</o:Created>
<o:LastSaved>2013-11-01T09:48:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>428</o:Words>
<o:Characters>2445</o:Characters>
<o:Company>HOME</o:Company>
<o:Lines>20</o:Lines>
<o:Paragraphs>5</o:Paragraphs>
<o:CharactersWithSpaces>2868</o:CharactersWithSpaces>
<o:Version>11.5606</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
h2
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
mso-outline-level:2;
font-size:18.0pt;
font-family:"Times New Roman";
font-weight:bold;}
p
{font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
pre
{margin-top:0cm;
margin-bottom:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:197159006;
mso-list-template-ids:1295032526;}
@list l1
{mso-list-id:1007486822;
mso-list-template-ids:-15539760;}
@list l2
{mso-list-id:1124037889;
mso-list-template-ids:-431570068;}
@list l3
{mso-list-id:1536771509;
mso-list-template-ids:-737776110;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->
</head>
<body lang=EN-US link=blue vlink=blue style='tab-interval:36.0pt'>
<div class=Section1>
<p><a href="../as.htm">Return to Assignments</a> </p>
<h2 align=center style='text-align:center'><strong>DSA - Assignment 2</strong></h2>
<h1 align=center style='text-align:center'>Sale Management System</h1>
<h2 align=center style='text-align:center'>using Binary Search Tree data
structure</h2>
<p>INTRODUCTION<br>
Your <strong>second assignment in this block</strong> will be using binary
search tree data struture for implementing a small Sale Management System
(SMS) in Java language. <br>
SMS manages information about products, customers and product ordering items.
These information are:<br>
About a product:</p>
<ol start=1 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'>pcode (string): the code of
the product (this is the <b style='mso-bidi-font-weight:normal'>key of the
tree</b> and thus should be unique).</li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'>pro_name (string): the name
of the product.</li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'>quantity (integer): the
number of products with the same code in a shop at beginning of a
day.</li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'>saled (integer): the number
of products with the same code, which are saled in the day. Condition:
saled ≤ quantity. </li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'>price (double): The price
of the product.</li>
</ol>
<p>About a customer:</p>
<ol start=1 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l3 level1 lfo2;tab-stops:list 36.0pt'>ccode (string): the code of
the customer (this should be unique for the customer).</li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l3 level1 lfo2;tab-stops:list 36.0pt'>cus_name (string): the name
of the customer.</li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l3 level1 lfo2;tab-stops:list 36.0pt'>phone (string): The phone
number of the customer (must contain digits only).</li>
</ol>
<p>About ordering:</p>
<ol start=1 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l0 level1 lfo3;tab-stops:list 36.0pt'>pcode (string): the code of
the product to be ordered.</li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l0 level1 lfo3;tab-stops:list 36.0pt'>ccode (string): the code of
the customer.</li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l0 level1 lfo3;tab-stops:list 36.0pt'>quantity (integer): the
number of ordered products.</li>
</ol>
<p>YOUR TASKS<br>
You should use 1 binary search tree to store data for products and 2 linked
lists, each one is used to store data for customers or ordering items. You
should create the data structures from scratch, do not use structures available
in java.<br>
On running, your program displays the menu as below:</p>
<p>Products (8 marks) (using Binary Search Tree data structure, where
bcode is the key of the tree):<br>
1.1. Load data from file<br>
1.2. Input & insert data<br>
1.3. In-order traverse<br>
1.4. Breadth-first traverse<br>
1.5. In-order traverse to file<br>
1.6. Search by pcode<br>
1.7. Delete by pcode by copying<br>
1.8. Simply balancing<br>
1.9. Count number of products</p>
<p>Customer list (1 mark):<br>
2.1. Load data from file<br>
2.2. Input & add to the end<br>
2.3. Display data<br>
2.4. Save customer list to file<br>
2.5. Search by ccode<br>
2.6. Delete by ccode</p>
<p>Order list (1 mark):<br>
3.1. Input data<br>
3.2. Display data with total value<br>
3.3. Sort by pcode + ccode</p>
<p> <br>
Submission Requirements<br>
Create the directory with a name like <strong><class>-<name><roll
number>-ASS1</strong>, e.g.<br>
<strong>
SE0508-QuangTV00456-AS1
(1)</strong><br>
The (1) directory contains the following files:</p>
<ol start=1 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l1 level1 lfo4;tab-stops:list 36.0pt'>The run.bat file to
run your program.</li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l1 level1 lfo4;tab-stops:list 36.0pt'>Your source code files.</li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l1 level1 lfo4;tab-stops:list 36.0pt'>Your input test files.</li>
</ol>
<p>The statements in run.bat file may be:<br>
cls<br>
javac Main.java<br>
java Main<br>
pause<br>
del *.class</p>
<p>Compress the folder (1) <strong> </strong>to .zip (or .rar)
file (with the same name) and upload to cms.</p>
<p>Assignment assessment<br>
You will be asked to modify immediately and to explain your assignment in lab
room to be sure that you are really the author of the assignment you
submitted.</p>
<pre> </pre></div>
</body>
</html>