syeaw0 / CS1C---Class-Project-Warehouse

1 stars 3 forks source link

Inventory Reading in Backwards #36

Closed Axelm3sh closed 9 years ago

Axelm3sh commented 9 years ago

Well, not necessarily. It is outputting stuff backwards...

As seen here

********************************
* SALES REPORT FOR 2/1/2015
 *
********************************

ITEM      QUANTITY  COST      BUYER     
---------- ---------- ---------- ----------
1   .Envelopes5         2.99      
2   .Envelopes5         2.99      
3   .Paper Shredder1         199.99    
4   .Instant Coffee5         6.75      
5   .EPSON Printer Cart.5         32.50     
6   .EPSON Printer20        59.99     
7   .Most Basic DVD Player1         59.99     
8   .The Alamo6         19.95     
9   .Seinfeld Collection50        39.95     
10  .Shrek 21         19.95     
11  .Pork Tenderloin2         17.25     
12  .Ground Beef1         6.85      
13  .Rye Bread90        4.79      
14  .1 gallon milk88        5.49      
----------------------------------------

Also what's with the duplication towards the end??

SourceFile:

12345
1 gallon milk
5.49    88
67899
Rye Bread
4.79    90
12899
Ground Beef
6.85    1
12899
Pork Tenderloin
17.25   2
12899
Shrek 2
19.95   1
12345
Seinfeld Collection
39.95   50
67899
The Alamo
19.95   6
67899
Most Basic DVD Player
59.99   1
12345
EPSON Printer
59.99   20
88888
EPSON Printer Cart.
32.50   5
67899
Instant Coffee
6.75    5
12899
Paper Shredder
199.99  1
56723
Envelopes
2.99    5
mciver24 commented 9 years ago

both lists are stacks so they are out putting the things on top first. To change this we need to make a double linked list and sort it, or use a somewhat more complicated method to sort the stack

Axelm3sh commented 9 years ago

non-issue, we shall sort it alphabetically later