Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CLO2 Outline a solution with the help of Pseudocode and Individual Assignment
Graphical representation. (C1, PLO3)
Wisdom College in Langkawi is providing accommodation for its students. The types
of accommodation and its related details are given in the table below:
Block Gender Room Type Rooms Weekly Rate (RM)
per
Room Internet Meal Laundry Gym
Block
A1 Single Bed 400 40
A2 2-Bedded 200 20
Male
A3 3-Bedded 150 15
A4 4-Bedded 100 10
100 120 20 10
B1 Single Bed 400 40
B2 2-Bedded 200 20
Female
B3 3-Bedded 150 15
B4 4-Bedded 100 10
You are required to write a program for managing the hostel booking of Wisdom
College.
You are required to store all data in text files. There is no limit on the number of text
files that can be used but they should be kept minimum. You should use array,
structures and functions (called by value and/or reference) in your program. All the
features in your program must be coded in separate functions and called from a menu
function. You may include some analytics in your program as additional features like
percentage of occupancy by gender or room type; percentage of occupants who stay
with/without subscribing to meal and/or laundry service; or any other feature(s).
Important Note:
Due to some delay in construction, assume only 4 blocks are ready for occupancy
which include at least one from block A1-A4 and one from block B1-B4. Also, due to
some reasons, only two of the services with an exclusion of meals OR only one of
services with an inclusion meal are available for subscription. Hence, you are required
to check with your lecturer the blocks and service(s) (with/without meal) that are
available for you to consider when writing the program. Take note that each of you
will be assigned with different group of blocks and service(s) (with/without meal) to
work on.
Sliding puzzles are games that require players to slide and play the game. 8-puzzle is
a kind of sliding puzzle game that requires the player to slide the numbers on the
board and arrange them in ascending order. Sample sliding movements in 8-puzzle
game is shown in the following figure:
After a number of further movements, the state of puzzle is reached as in the figure
below until reaching the winning state:
Similarly, a 15-puzzle contains numbers from 1 to 15 and an empty space for sliding.
You are required to simulate both 8- and 15-puzzle games in your program. Every
player needs to be registered and given a player code before playing the game. The
player code has to be generated by the program and must be in sequence, starting
from 1001. The player codes and their respective names have to be stored in a text
file. The file has to be checked for player name duplication before a new player is
registered and given a new player code.
The achievement of the players, i.e. the number of steps taken for winning each of the
puzzles need to be stored in another two different text files, i.e. one for 8-puzzle
winners and the other for 15-puzzle winners. The puzzle winner files must only
contain player code and number of steps taken to win the game. Altogether, there
should be at least 3 text files.
Players should be directed to 8-puzzle followed by 15-puzzle game. Players can exit
the game at any point of time should they feel so. After winning each puzzle, the
program must display the details of other winners of the same puzzle. The list must be
tabulated with player code, player name and number of steps taken for winning the
puzzle. The table must be sorted with players who won the game with least number of
steps being listed first.
You should use array, structures and functions (called by value and/or reference) in
your program. All the features in your program must be coded in separate functions
and called from a menu function. You may include some additional features in your
program like allowing players who had won both puzzles to play selected puzzle
again for improving their achievements; or any other useful and interesting features.
You have been approached by the University to develop a simple Queue Management
System for APU collection centre. This system has two parts. The first part requires you
to develop a program to simulate a queue management system while the second requires
you to store each teller’s activity in a text file and produce their productivity report.
First Part
The queue management system consists of four main components namely Ticket
Dispenser Device, LED Counter Display, Calling Device (keypad) and Counter
Controller as shown in the Figure 1.
Figure 1: Queue Management System
The Counter Controller will act as a brain of the system, which will control and manage
the following devices:
i. Ticket Dispenser Device
Dispense tickets to customer when he or she entered the premises and tabbed
the button on the screen.
Dispensed ticket will show the current running number and number of persons
waiting in queue.
ii. LED Counter Display
Shows current queue number and counter number. It will display the
current queue number and its respective counter.
Figure 2 shows the Pin Diagram of LED Counter Display. Following are the
description for the pins in LED Counter Display:
D0 – D7 data pins are used to read / write data to the LED Counter Display.
These pins are used to display a queue number from 000 to 255. The queue
number should be reset to 000 at beginning of each day that is before the
operation of the collection center or when the students visiting the center
exceeds 255. All the pins are set to 0 when the reset function is applied. For
initial queue number 001, only pin D7 will be set to 1 and the rest are set to 0.
VSS, VDD and VEE are voltage supply pins.
RS pin is to choose either instruction register or data register to write the data.
The E pin (enable pin) is used to enable the write operation to the register.
However, in our case, we will use these two pins to indicate the counter
number. Set both pins to zero when indicating counter 1; set RS pin to 0 and E
pin 1 when you want indicate counter 2; set RS pin to 1 and E pin 0 when you
want indicate counter 3; and set both of them to 1 when indicating counter 4.
R/W pin will be used to select a particular mode (read/write) data from/to
LED Counter Display. R/W pin is set to 0 or 1 for reading/writing data from/to
LED Counter Display respectively. You are required to set the value for R/W
pin before performing the read or write operation on the LED Counter
Display.
Figure 2: LED Counter Display Pin Diagram
iii. Calling Device (Keypad)
Used for calling a specific queue number.
Used for echoing the current queue number if required.
Used for calling the next queue number.
Keypad used as Calling Device is shown in Figure 3 below. As there are not many
keys available on this keypad, you are required to carefully mapped the keys in
them to the functionalities required in this system. Also take note that same
Keypad will be used to echo the called number if required.
Figure 3: Keypad Used as Calling Device
Second Part
Every service provided by the tellers at each counter is recorded in a text file. Sample text
file is shown in Figure 4 below. You are required to store at least the date of service,
counter number and queue number served as shown in the text file. For time being we
will assume that each counter is managed by the same staff until he/she resigns or is been
promoted or transferred to other branch. You are required to build a function to read the
content of this file into a structure and count the number of customers served by each
teller from beginning until now. Finally, their productivity is displayed as shown in Figure
5.
Figure 4: Sample Text File Keeping Service Records
Figure 5: Productivity Report by Staff
2.0REQUIREMENTS
i. You are required to carry out extra research for your system and document any
logical assumptions you made after the research.
ii. Your program should use symbolic constants where appropriate. Validations need
to be included to ensure the accuracy of the system. State any assumptions that
you make under each function.
iii. Your program must be modular, user-friendly using programming techniques that
you have learnt. You may include any extra features which you may feel relevant
and that add value to the system. The menus could be modified in order to
facilitate more options.
iv. There should be no need for graphics in your program, as what is being assessed,
is your programming skill not the interface design. The marking scheme for the
assignment has been provided so that you clearly know how the assessment for
this assignment would be done.
v. You should include the good programming practice such as comments, variable
initialisation, naming conventions and indentation.
vii. You are required to use portable ANSI C to implement the solution. Use of any
other language like C++/java etc is not allowed. Global data is not allowed.
3.0DELIVERABLES
iii. CD Content
- Documentation file (.doc file if using Ms-Word)
- Program / Source files (.c files)
- Header files (.h files) - optional
- Executable file (.exe file)
4.0ASSESSMENT CRITERIA
v. Demonstration 5%
Know how to execute and able to trace the system
5.0PERFORMANCE CRITERIA
Credit (65%-74%)
This grade will be assigned to work which is considered to be of good standard and meets
most of the requirements stated in the question. The program runs smoothly when executed.
There is clear evidence and application of C concepts up to at least intermediate level. The
program solution is unique with good coding styles and validation. The program
implemented maps well against the design (pseudo code and flowchart) as seen in the
documentation. The design of the solution varies in styles and has unique logic with minor
errors / omissions. The documentation does not have any missing components. Sample
outputs documented with some explanation. All work is referenced according to Harvard
Name Referencing convention but with some minor errors / omissions. Student must be able
to provide good explanation of the codes and work done, answer most questions posed with
mostly accurate / logical answers / explanation. Overall a good assignment submitted.
Pass (50%-64%)
This grade will be assigned to work which meets at least half of the basic requirements
(approximately 50%) stated in the questions. The program runs smoothly when executed.
There is clear evidence and application of C concepts at basic level. The program solution is
common with basic coding styles and validation. The program implemented somewhat maps
with the design (pseudo code and flowchart) as seen in the documentation. The design of the
solution is average in terms of logic and style with some errors / omissions. The
documentation has some missing components. Sample outputs documented but without any
explanation. Did some referencing but not according to Harvard Name Referencing
convention and with some minor errors / omissions. Student must be able to explain some
codes and work done and able to answer some questions posed with some accurate / logical
answers / explanation. Overall an average piece of work submitted.