Lab 4
Personal Diary¶
Requirements¶
The Personal Diary is a CLI (Command Line Interface) software that consists of four programs:
pdadd
pdlist [ ]
pdshow
pdremove
-
pdaddis used to add an entity to the diary for the date. If an entity of the same date is in the diary, the existing one will be replaced.pdaddreads lines of the diary from the stdin, line by line, until a line with a single.character or theEOFcharacter (Ctrl-Din Unix andCtrl-Zin Windows). -
pdlistlists all entities in the diary ordered by date. Ifstartandenddates are provided through command line parameters, it lists entities between the start and the end only. This program lists to the stdout. -
pdshowprints the content of the entity specified by the date to the stdout. -
pdremoveremoves one entity of the date. It returns 0 on success and -1 on failure.
The software stores the diary in one data file, and reads it to the memory at the beginning of each program, and stores it back to the file at the end of the process.
Evaluation standard¶
- C++ code quality (clean, compact, and reasonable)
- Comments quality
- Common classes and functions should be shared between programs
- These programs are physically independent, so direct interaction is not permitted
- These programs are able to work together by means of redirection
- These programs are able to be used in a shell/batch script
Files to submit¶
Please prepare a .zip package including the following items:
- The source code
- A shell/batch script with several use cases for your software (cover all programs)