CSCI 159 Structs and Pointers Lab (Prep for Quiz 3)

CSCI 159: Fall 2024 Lab 6.5 (Lab 6 and 1/2 for Section 5)

Struct and Pointers (Prep for Marksbooster quiz)

  1. In a directory of your making (it could be a lab6 directory in csci159dev), copy ~gpruesse/159/groc.cpp into that directory.
  2. Amend the program so that it gets from the user grocery items and the number of such items to be recorded on the grocery list. Notes from class may be useful. The grocery list can be maintained in unsorted order.
  3. Bonus: Amend the program so that all inserts are done not necessarily at the head -- rather, assume the list is sorted, and ensure the item is inserted into the correct spot in the list in sorted order, alphabetically by the item. Strings can be compared by using the <, > <=,&>;= comparitors


Useful Links: Gara Pruesse's Homepage
Computing Science Homepage
Vancouver Island University Homepage
X2Go