DUE DATE: | 5:00pm Tuesday 29 January 2002 (extension announcement) |
---|---|
WEIGHT: | 10% |
SUBMISSION NAME: | comp2004s.a2 |
MARKING TYPE: | automated testing and hand marking |
TASK: | Write a Calendar system |
calendar
.
calendar add <date>
<date>
can have the following forms:
calendar [date]
all
is given for the date then all the entries past, present and future should be output
calendar purge
$CALENDAR_DATE
, which
will be stored in the format output by the date
command,
for example Mon Jan 14 12:47:19 EST 2002
.
bash$ export CALENDAR=calendar.file bash$ export CALENDAR_DATE="Thu Jan 24 12:47:19 EST 2002" bash$ calendar add 14/1 Assignment 1 (String Class) due for COMP2004 bash$ calendar add 11/2/02 Assignment 3 (Paging Simulation) due for COMP2004 bash$ calendar add 25/1/2002 Assignment 2 (Calendar System) due for COMP2004 bash$ calendar Fri 25 Jan 2002 : Assignment 2 (Calendar System) due for COMP2004 bash$ calendar 31/12 Fri 25 Jan 2002 : Assignment 2 (Calendar System) due for COMP2004 Mon 11 Feb 2002 : Assignment 3 (Paging Simulation) due for COMP2004 bash$ calendar all Mon 14 Jan 2002 : Assignment 1 (String Class) due for COMP2004 Fri 25 Jan 2002 : Assignment 2 (Calendar System) due for COMP2004 Mon 11 Feb 2002 : Assignment 3 (Paging Simulation) due for COMP2004 bash$ calendar purge bash$ calendar all Fri 25 Jan 2002 : Assignment 2 (Calendar System) due for COMP2004 Mon 11 Feb 2002 : Assignment 3 (Paging Simulation) due for COMP2004 bash$ exit
calendar
program, just make sure you put them in the tar file (and that make will
compile them if they are C++ code).
make
so you should make sure that if you have any C++, you have a corresponding
Makefile to compile it. If you did not use any C++ and thus do not
need make (eg, you have a shell script called calendar
which is already
set to be executable) then just ignore make - it will just run and do
nothing. After make has been run (whether it does anything or not), your
calendar
program must be able to be run.
calendar
which does
something very similar to the assignment, you are probably running
it instead, try running your program as ./calendar
getenv
that you can
call. See the man page (run the command man getenv
) for
details. Basically you will use getenv("CALENDAR")
to get the name of
the file to use, and the obvious for the date.
cin
and cout
so once you see
the examples of how to create them it should be easy.