Move your work of Lab 1 to
VxWorks operating system. Make the following changes:
1) A node in the trees corresponds to an item in a sales system. Each
node contains
two attributes for the corresponding item:
- a unique item ID, in range of
[100, 999];
- the price of the item,
in range of [0.19, 99.99].
When inserting a new node, the price should also be input by the user.
2) Add a
new function update(itemID, itemPrice), which
updates itemPrice of an
existing node referenced by the
itemID with the provided new itemPrice.
3) Always do search before inserting a new
node. If the "new" node is
already in the system, perform update
operation on the node automatically.
4) The lookup operation should display the item price.
5) The print function should display each node in the
format of itemID(itemPrice).
6) Replace the main function in Lab 1 with a couple of
separate functions, each
of which allows users to invoke
a specific operation (insert, lookup, update,
delete, print) on the
trees from the WindSh shell. The shell commands should be
like:
-> insert (123,
9.99)
-> update (123, 11.99)
->
lookup 123
-> delete 123
-> print
7) Write a BSTHelp function to display instructions on the
use of your application.
On the due day, you need to submit a softcopy of your source code. You
will also
need to give me a demo in
the real-time lab.