Vous êtes sur la page 1sur 10

STUDENT’S LECTURE MANUAL

TK1913 – C PROGRAMMING
SEMESTER 1 SESSION 2004/2005

The aim of this manual is to provide guidelines for the course.

1. Learning Objectives

At the end of the course, the student should

1. know the syntax of C language and have skills to develop C programs.


2. be able to use several techniques and tools to design and code a program.
3. know the process of debugging syntax, logical and semantic error of C program
under the Linux environment.
4. obtain an experience to solve programming problem during lecture as well as real
programming problem through industrial problem solving which involve individual
project.

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.

3.2 Lecture Material


1. Lecture slides can be obtained and downloaded from UKM e-portal.
2. For certain topics, additional notes will be provided to support the available slides.

3.3 Method of Delivery


Lecture will be delivered to cover the following issues:
1. explanation about basic concepts and the syntax of C language.
2. explanation about flow of program control by using simulation.
3. explanation of theory aspect by giving examples.
4. strengthening the understanding of main topics by giving example in industrial
application.
5. demonstration of a method to solve selected problems.
6. use of software tools to support certain topics such as CFlow for topic Algorithm.
7. giving guidelines to implement individual project.
8. giving guidelines to self-learning.

4. Student’s Responsibilities

As a student, you are required to find out:


a. Which lecture group you belong to
b. Who is your lecturer
c. When is your lecture slot

Student’s Lecture Manual 1


d. Where your lecture will take place

To be able to fully understand the lecture, you are advised to:


a. understand the course objective and course content
b. revise the previous lecture topic before attend the next lecture.
c. Try some exercises related to the lecture topics from the reference books
d. Effectively involve in group discussion when discussing about tutorial
e. Write and run several programs related to the lecture topics
f. Resolve any problems regarding the previous lecture by asking a lecturer or
outstanding friends

It is important to note that:


a. Attendance is not compulsory.
b. However, you are advised to attend all the lectures.
c. Some information regarding the course such as examination hints, programming tips
and such others may only be delivered during lecture.
d. Please note that the faculty will NOT accept any complaint regarding uninformed
messages just because the student did not attend the respective lecture.

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:

6.1 Main References


1. Marini Abu Bakar, Norleyza Jailani dan Sufian Idris, 2002. Pengaturcaraan C,
Prentice-Hall.
2. Forouzan, B. A., 2001. A Structured Programming Approach Using C, Brooks/Cole
Thomson Learning

6.2 Additional References


1. Hanly J. R., Koffman E. B., 2002, Problem Solving and Program Design in C (3rd
Edition), Addison-Wesley.
2. Corriveau, J.P., 1998, A Step-by-Step Guide to C Programming, Prentice-Hall
International. Inc.
3. Deitel, H. M. and Dietel, P. J., 2000. C How To Program (3rd Edition), Prentice-
Hall.
4. Kelly, Al and Pohl, Ira., 2000. C by Dissection: The Essentials of C Programming (4th
Edition), Addison-Wesley Pub Co.

Student’s Lecture Manual 2


7. Course Contents

TOPICS and CONTENTS Hours

Topic 1: Introduction to Computer and Programming


1
Knowledge
Understand the definition of computer, hardware, software and
programming

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)

Topic 3 : Introduction to the C Language


1.5
Knowledge
Understanding the structure of C in the Linux environment.
Skills
Able to edit, compile and execute a C program.

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

Topic 4: Variables and Constants


1
Knowledge
Understand the concept of identifier as a storage location.
Skills
Able to identify and define the data type in C program.

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

Topic 5 : Input and Output


2
Knowledge
Understand various form of input and output statements.
Skills
Able to write a program to read input and print output.

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)

Conclusion, discussion 0.5

Student’s Lecture Manual 4


TOPICS and CONTENTS Hours
Topic 6: Operator and Expression
1
Knowledge
Understand the basic arithmetic operator and its precedence.
Understand and able to evaluate an expression that contains relational
operators, increment and decrement operators, type cast operator and
conditional operator.
Skills
Strengthen the computer arithmetic skills.

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

Topic 7: Control Structure: Selection


3
Knowledge
Understand various types of selection statements.
Skills
Able to write a program that use selection statements.

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

Student’s Lecture Manual 5


TOPICS and CONTENTS Hours
Topic 8: Control Structure: Repetition
3
Knowledge
Understand various types of repetition statements.
Skills
Able to write a program that contains repetition statements.

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

Student’s Lecture Manual 6


TOPICS and CONTENTS Hours
Topic 10: Arrays
Knowledge 3
Understand the concept of arrays.
Skills
Able to write an application program by using one and two dimensional
arrays.

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

Topic 11: Characters and Strings


1
Knowledge
Understand the basic concept of characters and strings.
Skills
Able to write programs that involve handling of characters and strings.

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

Topic 12: Structures


4
Knowledge
Understand the concept of structure.
Skills
Able to write programs by using structures.

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.

Student’s Lecture Manual 7


TOPICS and CONTENTS Hours
Topic 13: Files Manipulation 1

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

Student’s Lecture Manual 8


8. Course Schedule Summary
Week Lecture Project Tutorial Lab
W1 K1: Topic 0: Course Briefing Understand the problem. T0 L0
Topic 1: Introduction to Tutorial briefing Lab briefing
Computer and Programming

K2: Topic 2: Algorithm

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

W6 K11: (cont) Use repetition control structure to


handle repetition process such as input
K12: Topic 8: Control Structure: and testing in the algorithm.
Repetition

W7 K13: (cont) First Submission: T4: Control Structure: if- L4:


Description of program interface else, switch Control Structure: if-else, switch
K14: (cont) design (input/output) and full • CGPA Calculator

Student’s Lecture Manual 9


algorithm solution using pseudocode or Problem
flowchart.
W8 K15: Topic 9: Function Revise algorithm and identify sections
of algorithm that are better
K16: (cont) represented using function.

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

W12 K23: (cont) Program Testing

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

W14 K27: Evaluation of students course


work performance

K28: Revision, conclusion

Student’s Lecture Manual 10

Vous aimerez peut-être aussi