首页 > > 详细

Help C/C++ Programming,C/C++ Experiment Help With,Help C/C++ Programming,C/C++ Programming Cours

A program is needed by a sports store to track its inventory and sales. All transactions are
in a file as shown in this example:

B Basketball B8#Birmingham Sports#25
B Flying Disc Hi-Flier#Niles Outdoors#10
S Flying Disc Hi-Flier#Bev Canton#2
S Pro Tennis Racquet#Chris Benson#3
B Short Flippers#Real Swim#12
B Flying Disc Hi-Flier#Niles Outdoors#5
S Basketball B8#Pinpoint School District#28
B Basketball B8#Birmingham Sports#25
S Short Flippers#Mark Pierce#1
S Flying Disc Hi-Flier#Peter Cotton#1
R Short Flippers#Real Swim
B Dumbbell 10 lb#Niles Outdoors#10

The code B means a buy from a supplier, R to remove an item, and S means a sale to a customer.
For a buy, there is the item followed by the supplier followed by how many of the item bought.
For a sale, the S is followed by the item sold, the customer name, and the quantity. For a remove,
there is no quantity but just the item and supplier names.
The program is to process the buys, removes, and sales in the order that they occur in the
file. Output from the program is two files. The first output file is the inventory in order by item.
The second file is the sales in order by customer name.
Here's an example run:

Enter the transaction filename: transactions-Oct-24-2017
Enter the Buys report filename: buys-10-24-2017
Enter the Sales report filename: sales-10-24-2017

For the above transaction file, buys-10-24-2017 should look like:

Basketball B8#Birmingham Sports#22
Dumbbell 10 lb#Niles Outdoors#10
Flying Disc Hi-Flier#Niles Outdoors#12

And, sales-10-24-2017 should look like:

Flying Disc Hi-Flier#Bev Canton#2
Pro Tennis Racquet#Chris Benson#3
Pro Tennis Racquet#Chris Benson#0
Short Flippers#Mark Pierce#1

Flying Disc Hi-Flier#Peter Cotton#1
Basketball B8#Pinpoint School District#28
Basketball B8#Pinpoint School District#3

The buys output file has all the items in the inventory, including the final quantity for
each. The exception is items that have been removed. Note that the quantity for an item is zero or
more.
The sales output file is almost an echo of the sales transactions except for two cases.
First, if a sale is for an item not in the inventory, then the sales output has two lines. The first is
the item name, customer name, and quantity. The second line is exactly the same except that the
quantity is zero. This second line indicates that the item did not exist.
The second case is when a sale is for more than what is in inventory. In this case, the
sales output again has two lines. The first is the item name, customer name, and quantity that was
filled. The second line is exactly the same except that the quantity is was what not filled. This
second line indicates that the item is to be backordered. (Note: There is no other requirement for
tracking any backorders.)
There are no syntax errors in the data. Furthermore, it is guaranteed that all transactions
have a quantity of one or more except for removes, which have no quantity.
This assignment requires a sorted list class. This class will be used to declare two objects
in the client, one for tracking inventory and the other for sales.
The class will also have enum Order {ITEM, CUSTOMER};. In this way, when the
client processes a buy, the client will have a call similar to inventory.Insert(data, ITEM); that
indicates that data is to be inserted in item order. It is also a requirement that the program use
binary search instead of any sequential searching. For a sale, the client does sales.Insert(data,
CUSTOMER);.
The program is due Monday, November 13. There are three files making up the program:

mylist.h – the specification file
mylist.cpp – the implementation file for mylist.h
sportsstore.cpp – the client

In addition to handing in a source printout of the program (each file), you are required to submit
it electronically (all three files). You are also required to hand in a top-down design and a UML
design.

 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!