30220392 (Foundations of Computer Programming)

Course Name: Foundations of Computer Programming

Course Number: 30220392

Program: Undergraduate program

Type: Required

Credits: 2

Term Offered: Spring

Prerequisite(s): Basic knowledge of computer use

Instructor(s): Guangyu He


B.W Kernighan, D.M. Ritchie, C Programming Language (2nd Edition), P rentice-Hall, 2004.


Tang H.Q, C Programming, Tsinghua Univ. Press, 1999.


Course Description:

 Advanced Language Programming is a basic course of computer teaching. It covers the basic knowledge of C programming language, including variable, type, expression, judging statement, loop statement, function definition and call, pre-compiled command, array, pointer, structure, linked list and standard function library. Its main concern is the knowledge of using computer language to analyze and solve problems, including the basic concepts of structured programming, data structures and algorithms, environments of Visual C++ integrated developing and debugging, ability of actual programming and debugging using computer language.


Course Objectives and Outcomes:

1.Students should skillfully master the knowledge of C Programming Language. [1, 3, 9, 11]

2.Students should write well-prepared, readable programs with a strong operational capability. [5, 11]

3.Students should have the ability to analyze and solve problems using computer thinking. [11]


Course Topics:

l  C Language Overview(6 hours)

1)C language development overview

2)basic output statements and simple C programming design

3)simple judging statement

4)simple loop statement

5)simple program using assays

6)simple program using functions

 Through this chapter, students should clearly understand C language in general, proficiently master the output statement of C language and basically master the simple judging and loop statements. Besides, students should have an initial understanding of C array and function, and write simple C programs.

l  Simple C Program Design and Basic Data Type (4 hours)

a) variable name

b)basic data type

c) constant


e) arithmetic operators

f) logical Operators

g)relational Operators

h)type Conversion

i)  increment operator and decrement operator

j)  bitwise operator

k)assignment operator and expression

l)  conditional Expression

m)operator precedence and expression

Through this chapter, students should correctly understand the roles, scopes, definitions, expressions and basic calculation methods of various data types. Besides, students should understand various operators, expressions and statement compositions, and skillfully write simple C programs.

l  Basic Statements of C Programming Design (2 hours)

1)statement and program block

2)if-else statement

3)else if statement

4)switch-case statement

5)while, for statement

6)do while loop

7)break, continue, exit, ()

8)goto statement and label

This chapter mainly introduces basic statements of C language. Through this chapter, students should firmly master various control statements and skillfully apply them.

l  Function and Program Structure (6 hours)

1)basic function knowledge

2)returning function value

3)global variable

4)scope rules

5)header file

6)static variable

7)register variable

8)block structure



11)C preprocessor

Function is the most important concept in C language, and the basic unit of C program. Through this chapter, students should have a deep understanding of the concept of function. The important and difficult part of this chapter is data pass between functions, so additional knowledge of stack is needed. Student should be able to write large programs with multiple functions and files.

l  Pointer and Array (6 hours)

1)pointer and address

2)pointer and function parameter

3)pointer and array

4)address arithmetic

5)character pointer and function

6)pointer array and pointer pointing to pointer

7)multidimensional array

8)initialization of pointer array

9)pointer and multidimensional array

10)command-line parameter

11)pointer pointing to function

12)complex statement

Pointer is the most flexible and powerful tool in C language, which has close relationship with array. This chapter introduces the concepts of array and pointer. Students should pay attention to basic and important knowledge of this part.

l  Structure (4 hours)

1)basic knowledge of structure

2)structure and function

3)structure array

4)pointer pointing to structure

5)self-referential structure

6)table search

7)type definition


9)bit field

This chapter introduces common knowledge used in data structure. Through this chapter, students should master the method of self-defining data types, and lay a sound foundation for further study of data structure and object-oriented program design.

l  Standard Input and Output Statements (6 hours)

1)standard input and output

2)format output

3)variable-length parameter table

4)format input

5)file access

6)error handling

7)line input and line output

8)other functions

Through this chapter, students should master standard input and output statements and basic concepts of file, and can use the knowledge to write programs.


Experiment(s) Teaching: 48 hours

l  Experiments every week (6 hours)

1)It is designed 2 hours per week. The main content is to complete the homework on computer.

2)Experiments are used to improve students’ on-line programming skills, enhance their interest in programming and help them to better master the basic knowledge such as data type, input statement, output statement, control statement, array, function, pointer, structure and file, etc.

l  Programming Competition and On-line Test (10 hours)

1) There are three on-line tests on the week 4, 8 and 12. The contents are on-line exercises and their deformations during the first 4 week before the test. The three tests are arranged in groups.

2)At the beginning of this course, students are divided into several groups, each group of 5 to 6 people. During the three tests, one person for each group is randomly selected to take the on-line test and oral examination, and his/her scores belong to other people in the same group. This way is used to promote communicating and learning among students. At the same time, in order to prevent individual students with bad scores to have a great impact on other members in the group, it is regulated that: If someone fails the test, the scores are only 2 points fewer and another student in the group is selected for the test again.

3)There is a programming contest arranged on the week 13. The subject is relatively difficult. The winners’ final scores will have extra points added as appropriate.

4)There is the final on-line programming examination on the week 16. Different from the three tests, the final examination has nothing to do with the homework and for each student separately.

l  Free On-line and Q&A Time(6 hours)

There are 6 hours of free on-line experiments arranged for students. Students can do on-line experiments freely according to their own needs. Teachers can carry out unified or dispersed Q&A as needed.


Course Assessment:

 Three on-line tests, 20 points for each.

 Final on-line programming examination, 30 points.

Homework and discipline, 10 points.