Algorithms and Data Structures in C CE00869-1 Page 1 Algorithms and Data Structures in C CE00869-1 Assignment: Taxi Rank Hand out date: 21.02.2011 Part One Demonstrations: During week 07.03.2011 to 11.03.2011 Part Two Demonstrations: Part Two Hand-In Deadline: During week 04.04.2011 to 08.04.2011 08.04.2011 Problem specification – You are required to code and test a C program to simulate a queue of taxis in a taxi rank. When a taxi arrives, it joins the rear of the queue. When a taxi leaves the queue, the first taxi at the front of the queue leaves. Initially, the queue is empty. Each taxi is identified by a taxi registration number. The application program is to be menu-driven for the following eight tasks:1. arrive: A taxi arrives at the rear of the queue Add the taxi’s reg. number to the rear of queue 2. leave: A taxi leaves the front of the queue Display the reg. number of this taxi 3. search: Display whether a particular taxi, given its reg. number, is in the queue or not 4. print: Display the reg. numbers of all the taxis in the queue starting at the front 5. front: Display the reg. number of the taxi at the front of the queue 6. back: Display the reg. number of the taxi at the rear of the queue 7. empty: Display whether the queue is empty or not 8. exit: Terminate the program Algorithms and Data Structures in C CE00869-1 Page 2 Part One – The queue is to be implemented as an array of some maximum size. Taxi registration numbers are to be integers. The menu options for the eight tasks above are to be the integers, 1 to 7, and 8 for exit. There is no hand-in for Part One. Part One is to be demoed to your tutor during the normal practical slots during the week of 07.03.2011 to 11.03.2011. Part Two – The queue is to be implemented as a linear linked list. Taxi registration numbers are to be alpha-numeric, e.g. A1234. The menu options for the nine tasks above are to be strings, e.g. “arrive” etc. This linked list may only be accessed by two pointers: front which indicates the front node in the queue rear which indicates the last node in the queue Pointers, front and rear, should be encapsulated in a C struct. A linked list node structure should also be encapsulated in a C struct. Part Two Hand-In Deadline is 08.04.2011. Part Two is to be demoed to your tutor during the week of 04.04.2011 to 08.04.2011. You must arrange a time slot with your tutor well in advance in order not to miss the deadline. Algorithms and Data Structures in C CE00869-1 Page 3 Submission and Assessment Part One Demonstrations: During week 07.03.2011 to 11.03.2011 There is no hand-in for Part One. Part One is to be demoed to your tutor during the normal practical slots during the week of 07.03.2011 to 11.03.2011. There is no separate mark for Part One. However, failure to demo Part One on time will result in a zero mark for the entire assignment. Part Two Demonstrations: During week 04.04.2011 to 08.04.2011 Part Two Hand-In Deadline: 08.04.2011 IMPORTANT: You will be asked some questions about your implementation during the Part Two demonstration. If you cannot answer the basic questions relating to your program, you will be penalised for this assessment. Part Two Submission Documentation comprising: Hard copy of listing of C code for Part Two, and Black Box Cases, Test Plan and Actual Results as screen shots for Part Two. Disc containing: Copy of documentation and Visual Studio (or equivalent) project including .c and .sln files. Part Two Assessment Criteria: 1. Functionality (i.e. does the program meet the requirements?) 40 marks Which comprises 5 marks each for the menu and the seven tasks: Arrive, Leave, Search, Front, Rear, Print and Empty. 2. Use of appropriate C language features: i. Use of linked list to implement a queue ii. Use of functions and parameters iii. Use of structs iv. Use of strings. 3. Robustness and validation of input. 4. Black box and test plan documentation. 10 marks 10 marks 10 marks 10 marks 10 marks 10 marks Note: If only Part One is completed marks can only be obtained for assessment criterion 1 and some of criteria 3 and 4 to achieve a maximum mark of 45%.