Anda di halaman 1dari 14

INDIVIDUAL ASSIGNMENT

CT018-3-1-ICP
INTRODUCTION TO C PROGRAMMING
NAME

: SREE PRAKASH A/L BASKARAN

STUDENT ID

: TP032890

INTAKE CODE

: UC1F1308SE

LECTURERS NAME

: MUHAMMAD FIRDAUS BIN


CHE ABDUL RANI

HAND OUT DATE

: 3RD March 2014

HAND IN DATE

: 2ND June 2014

WEIGHTAGE

: 100%
1

Table of Contents
Introduction ........................................................................................ 3
Assumptions ....................................................................................... 4
Program Design................................................................................... 5
Flowchart ......................................................................................... 5
C programming concepts .................................................................... 8
Conclusion ........................................................................................ 13
References ........................................................................................ 14

Introduction
The purpose of the reservation system is to improve the customer service of Yums
Cafe and also improve efficiency of their business operations. With the automated
reservation service, all their records for current reservations can be stored on the computer
system itself. No need for papers or heaps of documents anymore.
This system is in place to manage customer reservation where it has the functions to
add a new reservation, cancel an exisiting reservation, update an exisiting reservation, view
the existing reservations and search for available tables and rooms.
This not only makes the business operations smoother and faster, but also makes
the job of the staff in charge of handling reservations easier. Locating an available table or
room can be done within seconds with a few clicks of a button. The data for new
reservations will be stored inside the system and this data can also be deleted as well as
modified.
There is no more need of multiple papers to keep track of reservations, especially in
terms of cancelling reservations and updating them. Each time a reservation is cancelled, a
paper is wasted and each time a reservation required updating, a new paper is being used,
wasting the old one.
This reservation system helps Yums Cafe to manage their reservations in a much
more hassle free and efficient way.

Assumptions
1. The previous customer reservation of Yums Cafe was done manually on papers.
2. The staff knows that a table can accomodate up to 5 customers only.
3. The staff knows that a private room can accomodate up to 10 customers only.
4. The previous customer reservation system was inefficient and a hassle.
5. The staff knows what to input and what not to input.
6. The staff knows how to reboot the system in case of failure.
7. The staff knows how to use the newly automated reservation system.
8. The staff of Yums Cafe knows how to see which table and private rooms are available

based on the reservation system.


9. The need for error correction in the system is set to a minimum as the staff should

know how to avoid causing the errors.


10. The information provided by the customers are relevant to reserving a table or

private room.

Program Design
Flowchart

Figure 1 Main Menu Flowchart

Figure 2 Table Reservation

Figure 3 Private Room Reservation Flowchart

C programming concepts
1. Printf

The printf function displays anything within the (<text>);


So the first line of the code above will print:
********** YUMS CAFE RESERVATION SYSTEM **********

2. Scanf

The scanf function will scan the input from a user and place it in a variable.
The above code will scan an integer input from the user and place it in the variable tablechoice.

3. Variable

A variable is a named location in memory that is used to hold a value that may be modified by
the program. Variables are declared with a name and data type.
In the above code, the variable name is tablechoice and is declared with the data type, integer.

4. Comments

Comments are explanations or annotations that are included in a program for documentation
and clarification purposes. They are completely ignored by the compiler during the compilation.
Two types of comments are /*<comments>*/ and //<comments>.
In the above code, the comment is created using // and the comment is This is the menu for the
table reservation.

5. If-else

The if-else selection structure either performs an action if a condition is true and performs a
different action if the condition is false.
In the above code, if the condition (begin == NULL) is true then it will execute the statements
below it. If the condition (begin == NULL) is false, then it will execute the statements below the
else.
6. Preprocessor

A preprocessor directive starts with a #. In the above code, the #include <stdio.h> statement,
instructs the preprocessor to include the contents of the standard input output(stdio.h) in the
program. The standard within stdio.h contains certain functions such as printf and scanf.

10

7. Switch

The switch selection structure perform one of many different actions depending on the value of
an expression.
In the above code, if the user enters 1, it will go to case 1 and execute the statement below it. If
the user enters 2, it will go to case 2 and execute the statement. The break statement is used to
avoid infinite looping of the switch selection structure.

8. Dowhile loop

The do-while statement is a post-test condition control loop structure. The loop body is
executed at least once and then the while statement is checked if the condition remains true. If
it remains true, the loop body will be executed again.
11

9. Main functions

The main function is where the program execution begins. A function definition consists of
header and a body. In the above code, the main function is main(). The main() is the header and
the body isthe statements below the function within the curly braces, {}.

10. Structures

A structure are collections of related variables, but may be of different types.


In the code above, the struct node is initialised with the variables inside the curly braces.

12

Conclusion
In conclusion, the Yums Cafe reservation system will help the business in their daily
operations. All inefficient handling of reservations will be abolished and there is no more
need of manual reservation system. This system helps Yums Cafe store the information
about reservations and makes it easier for them to make reservation, to delete reservations,
update reservations and view reservations.

13

References

CodingUnit Programming Tutorials, 2014. CodingUnit Programming Tutorials. [Dalam talian]


Available at: http://www.codingunit.com/c-tutorial-structures-unions-typedef
[Diakses 15 May 2014].
G.Kochan, S., 2005. Programming in C. 3rd ed. t.t.p:Sams Publishing.
Programiz, 2014. Programiz. [Dalam talian]
Available at: http://www.programiz.com/c-programming/c-structure-function
[Diakses 15 May 2014].
technoexam.com, 2011. technoexam.com. [Dalam talian]
Available at: http://www.technoexam.com/c-language-lecture-study-notes-tutorialsmaterial/difference-between-structure-and-union.asp
[Diakses 15 May 2014].
tutorialspoint, 2014. tutorialspoint. [Dalam talian]
Available at: http://www.tutorialspoint.com/cprogramming/c_program_structure.htm
[Diakses 15 May 2014].
Verma, D., 2014. Computer Programming. [Dalam talian]
Available at: http://dotprogramming.blogspot.com/2013/10/difference-between-structure-andunion.html
[Diakses 15 May 2014].

14

Anda mungkin juga menyukai