Programming Languages Practical Course
Perl AssignmentMelanie RiebackCS Dept., R4.23 Email: melanie@cs.vu.nl Spring 2005 Design and implement a prototype of a room reservation system in Perl. You should be able to reserve rooms with this reservation system. Reservations can occur for one or more consecutive periods. The length of a period should be a half hour. The following information should be recorded for every reservation: the room, for which periods it is reserved, and by whom. The following actions must be possible: reserve (reserve), cancel reservation (cancel), list the reservations with optional filtering by room, period, and requester (list), give instructions (help), end system (exit). The words in parenthesis after the actions are the commands to be used in the reservation systems. You must also be able to search for a free room with a certain capacity or certain characteristics (like a beamer present) in a certain period. The system must have an interactive commandline interface (a GUI is also okay, but it's a lot of work. See PerlQT for an example.) The syntax for the commandline interface (based on crontab) is fixed and provided below. Save the data in Perl data structures. The data must be persistent, meaning that the data should be saved when exiting the program, and read in when starting the program up again. Syntax commandsreserve room period user cancel room period user list [room] [period] [user] search [capacity] [property] period (parameters in square brackets are optional) Syntax parametersroom: room number, example: "S1.11"user: username capacity: integer property: example: "beamer present", "video wall present" period: [week] [day] [time] week: every combination of {integer, integer list, integer range} day: every combination of {integer, integer list, integer range} time: HH:MM-HH:MM integer list: integer, integer [ , integer , .... ] integer range: integer-integer Examplevalid period: "34 1,2,3 15:00-17:30"or "15,3-5 1,2,4-6 10:30-14:00" Error handlingErrors (ex. command syntax errors) must be handled, and the user must receive an explanatory error message.Value boundaries must be checked. This means that hour number <= 24, day number <= 7, etc.. In a range int1-int2, it must apply that int1 Starting upThe submitted program must have a number of rooms and users provided. There must also be some existing reservations in the system.DocumentationThe documentation must be in English, and must include a minimal user guide that describes how to start the program, explains what the various commands do (ex. cancel), and gives a description of the already available rooms, users, and reservations.Also describe the command output (ex. For the 'List' command, describe which kind of information appears in which column). Finally, the documentation should give a description of the program features, design choices that were made, and problems that were encountered and solved during development. SubmissionThe program and all other necessary files must be submitted in a tar file.ContactFor any questions related to this practical exercise, contact Melanie Rieback, office R4.23, e-mail: melanie@cs.vu.nl. Please, ask for an appointment by e-mail. Melanie also has a few Perl books that can be borrowed upon request, for use with this practical. |