Homework Assignment #8
Homework: modify the HalloweenStore2005 application
- see homework 7 where I gave out the RegisterUser2005
and HalloweenStore2005 application
- modify HalloweenStore2005 application to change the 2 files
that it uses:
categories.dat
products.dat
Change them to:
categories.txt
products.txt
Where both are simple text files
that use text strings instead of binary data.
use Notepad to make up your own data for these files,
e.g. categories, products, prices.
You need to have at least 2 categories
and at least 2 products in each category.
Change the IO code in the application
to read your text strings instead of the binary data.
- to get credit for this assignment,
Run your program for the instructor
then run Notepad to add another category and product in that category
and then run your program so the instructor can see the new product
and category.
- hint:
set up the structure of each file so it is easy for your program
to access the data.
Note: we have previously covered how to write strings to a text file
but not how to read strings from a text file.
Use the help facility to do some research.