SE-352

Embedded Software

Lab Assignment 2    (Due Wednesday, Feb. 28)

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, 999.99].

        When inserting a new node, the price should also be input by the user.

 

   2)  Always do search before inserting a new node. If the "new"  node is
        already in the system, the insertion operation should be failed.


   3)  The lookup operation should display the item price.


   4)  The print function should display each node in the format of itemID(itemPrice).


   5)  Replace the main function in Lab 1 with a couple of separate functions, each
        of which allows users  to invoke a specific operation (insert, lookupdelete,
        print) on the trees from the WindSh shell. The shell commands should be like:

         -> insert (123, 9.99)        
         -> lookup 123
         -> delete 123        
         -> print


   6)  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 a demo to the class in our real-time lab.

Back                                   Last modified: 02/13/2007