Quiz for Chapter 2
Don't continue if you have not yet understand the lesson
Time: 30 min
- Show how stack and queue work.
- Now, make the 2 insert procedure that is able to insert items in the middle
of the list, one for stack and one for queue.
You are a good programmer if you solve all three problems before 20 minutes.
Challenge:
- In 35 minutes, you shall have redevelop the readme program (remember
last lesson's quiz), but the difference is you must use either queue or
stack to link the lines.
- Make a phonebook program. If you have made one you may continue developing
that. Use linked list The feature you must give is: Add entry, display
all (in a list), delete entry, search entry, modify entry, destroy all
entry, passwords to get in. Use nice colors and layouts. Users must be
able to sort the entries. You may use any sort methods. (Hint: in
sorting, you just change the contents, don't change the pointer links.
That make things easier.) This is all done in less than 3 hours.
- You can make a text editor by now in just 3 days. I assume you have
8 hours a day to work. Look at dos' edit program, feel it, then make one.
This is quite easy, so don't get discouraged. Use linked list, you'd better
use queue this time, because it's easier in this case. The features you
must give is: File, Edit, Options, and Help.
- File contains New, Open, Save, Save As, and Exit.
- Edit contains Copy, Cut, Paste, Delete, Find, Find and Replace, Find Next,
and Go to line number.
-
Option contains modify colors, auto save in xx minutes (Hint: use
gettime), create backup files, auto restore (in case the electricity is
down when editing).
-
Help contains On line help, index (Hint: use text files), shortcuts,
and about.
It is up to you the look is. You must give shortcuts exactly the same as
dos' editor, and <ctrl+s> to save, then <ctrl+o>
to open. Exit short cuts may be <alt+x> or <alt+q>.
(Hint: look for ASCII codes for such combined keys!) Users can browse
when opening and saving files. Saved files must compatible with other text
editors. Phew! You can add extras as you want. If you has 2 more days,
you can make your program edit 2 or more text files simultaneously, if
you want to.
Where to go?
Back to chapter 2
Advance to chapter 3, about double linked list and circular linked list.
To lesson 2 contents
My main tutorial homepage
My programming links
Contact me here
By: Roby Joehanes, © 1997, 2000