Académique Documents
Professionnel Documents
Culture Documents
TK1913 – C PROGRAMMING
SEMESTER 1 SESSION 2004/2005
1. Learning Objectives
2. Learning Methodology
This course will be conducted through the following methods: lecture, tutorial, lab
The aim of the lecture is to cover important topics of the course. Tutorial is a problem
solving session. Thus, solution for the tutorial session will be implemented in the lab
session.
3. Lecture Implementation
3.1 Conduct
1. Lecture will be carried out by a Course Lecturer
2. Lecture duration is 2 hours per week.
4. Student’s Responsibilities
5. Course Assessment
Final examination 50%
Tutorial exercise 10%
Lab exercise 20%
Individual Project 20%
6. Reference Books
Main reference books can be obtained from Computer Science Department, while stock
last. Students are advised to have at least one reference book from the following list:
Contents
1. Definition of a computer
a. Computer definition by IEEE & DBP
b. Illustration of Computer hardware
c. Definition and description of computer hardware
2. Computer Software
a. System software
b. Application software
c. Software Package
3. Computer Environment
4. Role of Computer
5. Brief History of Programming
6. Concept of Programming
7. Programming Languages
Topic 2: Algorithms
1.5
Knowledge
Algorithm representation by using flow chart and pseudo code.
Skills
Able to map problems to solution in a form of flow chart and pseudo code.
Contents
1. Example of algorithm in everyday life – tea break preparation
a. Conclusion – relation between process in daily life and
algorithm
2. Introduction to flow chart and pseudo code
3. Calculation of Apple’s Price Example
4. Car Park Payment Example
5. CFlow Demonstration (algorithm tool)
Contents
1. Based on an example of complete C program (approximately 20 lines):
a. Explanation of the concept of C language.
b. Explanation of the environment of program development.
c. Demonstration of the process of compilation and execution of a
program.
Student’s Lecture Manual 3
TOPICS and CONTENTS Hours
2. History of the C Language
3. Structure of a C Program
4. Example of a program: detail explanation of a program structure
Contents
1. Identifiers
2. Variables
a. Identifier as a variable
3. Variable Declaration
4. Data Type
5. Constants
6. Assignment of variable’s value
a. Simulation of the contents of computer memory
Contents
1. printf() function
a. printing a string
b. printing a value
c. default format specification
d. field width
e. combination of output specification
2. scanf() function
a. input variables (int, float, char)
Contents
1. Basic Arithmetic Operators
a. Addition, subtraction and multiplication
b. Division operation
i. Integer division
ii. Real division
c. Modulo operation
2. Arithmetic Expression
a. Precedence level
3. Assignment Statement
a. Simple assignment statement
b. Multiple assignment statement
c. Compound assignment statement
4. Relational Operators
5. Logical Operators
6. Increment and Decrement Operators
7. Type cast operator
8. Conditional Operator
Contents
1. Selection algorithm
a. single selection
b. dual selection
c. multi selection
d. exercise – solution demonstration
2. if statement
a. if
b. if-else
c. if-else-if
d. exercise – solution demonstration
3. switch and break statement
a. switch – case
b. switch – case – break
c. exercise – solution demonstration
4. Style of writing a program
5. Example of problem solving
Contents
1. Repetition Algorithm
a. Condition based control
b. Counter based control
c. Sentinel based control
d. Exercise – solution demonstration
2. for statement
a. syntax, tracing, example
b. exercise – solution demonstration
3. while statement
a. syntax, tracing, example
b. exercise – solution demonstration
4. do-while statement
a. syntax, tracing, example
b. exercise – solution demonstration
5. continue statement
6. break statement in loop
7. nested loop
8. style of writing a program - memory
9. example of problem solving
Topic 9: Functions
3
Knowledge
Understand structured design using function.
Skills
Able to write a program by using user defined functions and standard
functions.
Contents
1. Structured based division
a. Structured chart
b. Top-down design
2. User defined function
a. Function call
b. Function definition
c. Function prototype
d. Function control flow
i. Function without parameter
ii. Function with parameter
3. Variables scope
4. C Standard Library Function
5. Recursion
6. Example of Problem Solving
a. Solution demonstration
Contents
1. Why array?
a. Advantages of using array – program example
2. One dimensional Array
a. Array initialization
b. Array assignment
c. Example – program tracing
d. Array and function
i. Example
3. Two dimensional array
a. Example – program tracing
b. Array and function
Contents
1. Fundamental of characters and strings
2. String declaration
3. String references
4. Character Manipulation Functions
5. Input/Output function of characters and strings
6. Strings Manipulation Function
7. Array of strings
Contents
1. Why structure?
a. Advantages of using structure – program example
2. Structure definition
3. Referring an element of a structure
4. Array of a type structure
5. Elements of structure of a type structure
6. Structure and function
7. Various example of structure usage.
Knowledge
Understand the concept of files.
Skills
Able to write programs that involves input to and output from files.
Contents
1. Input Output Files
2. Modes of files
3. Files opening and closing
4. Writing to a text files – fprintf()
5. Reading from a text files – fscanf()
6. Additional function of Input Output Files
Conclusion
Evaluation of students course work performance 2
Revision, conclusion
W2 K3: (cont – demo C-Flow) Analysis of the problem. T1: Algorithms L1(a)
Topic 3: Introduction to the C • Identify the input, process and • Exchange Rate Introduction to Linux Environment
Language output Problem and CFlow
K4: (cont) Interface design
Develop an algorithm.
W3 K5: Topic 4: Variables and Constants Refine the algorithm. L1(b)
Input and output coding. Introduction to Program Development
K6: Topic 5: Input and Output Environment
W4 K7: (cont), conclusion, discussion Refine the process algorithm based on T2: Input and Output L2:
the games rules. • Calendar Problem Input and Output
K8: Topic 6: Operator and Expression
W5 K9: Topic 7: Control Structure: Use selection control structure to test T3: L3:
Selection the expression. Arithmetic Expressions Arithmetic Expressions
• Cyberview Seminar
K10: (cont) Package Problem
W9 K17: (cont) Perform analysis and identify data that T5: Control Structure: L5:
can best be represented as array. for,while, do-while Control Structure: for,while, do-while
K18: Topic 10: Array • Late Book Return
Problem
W10 K19: (cont) Module integration T6: Function L6: Functions
• Computer-assisted
K20: (cont) Learning Problem
W11 K21: Topic 11: Character and String Module integration T7: Array L7: Data Structure: Arrays
• Histogram Problem
K22: Topic 12: Structure
K24: (cont)
W13 K25: (cont) Second Submission – The Program T8: Structure and Strings L8: Data Structure: Struct
• Forming Plural of
K26: Topic 13: File Manipulation Noun Problem