CS1100 Introduction to Programming


Objectives:

The course aims to provide exposure to problem solving through programming. It aims to train the student to the basic concepts of the C programming language. This course involves a lab component which is designed to give the student hands on experience with the concepts.

Course Contents:

Module 1 : (Introduction to Computing) 6 lectures

Fundamentals of Computing, Historical perspective, Early computers. Computing machine. Problems, Pseudocode and flowcharts. Memory, Variables, Values, Instructions, Programs.

Module 2 : (Introduction to C) : 10 lectures

The language of C. Phases of developing a running computer program in C.
Data concepts in C Constants, Variables, Expressions, Operators, and operator precedence in C.
Statements Declarations, InputOutput Statements, Compound statements, Selection Statements. Conditions, Logical operators, Precedences. Repetitive statements, While construct, Dowhile Construct, For construct.
Data types, size and values. Char, Unsigned and Signed data types. Number systems and representations. Constants, Overflow.
Arrays. Strings. Multidimensional arrays and matrices.

Module 3 : (Modular Programming and Example Problems) : 10 lecture

Functions The prototype declaration, Function definition.
Function call Passing arguments to a function, by value, by reference. Scope of variable names. Recursive function calls, Tail recursion. Analysing recursion, Tree of recursion, linear recursion.
Sorting problem Selection Sort, Insertion Sort, Comparison between sorting algorithms. Sorting in multidimensional arrays. Sorting in strings.
Search problem Linear search and binary search. Comparison between search procedures. Recursive and Iterative formulations.

Module 4 : (More Data Types in C) : 14 lectures

Pointers Pointer variables. Declaring and dereferencing pointer variables. Pointer Arithmetic. Examples. Accessing arrays through pointers. Pointer types, Pointers and strings. String operations in C.
Structures in C. Motivation, examples, declaration, and use. Operations on structures. Passing structures as function arguments. type defining structures.
Selfreferential structures. Dynamic Data Structures. Linked Lists. Examples.
File inputoutput in C. Streams. Input, output and error streams. Opening, closing and reading from files. Programming for command line arguments.
Numerical errors due to data representations and machine precision. Approximation and error analysis. Illustration through examples.

Text Books:

C: How to program, H. M. Deitel, P. J. Deitel, 7th edition, Pearson Education, 2010.

Reference Books:

• R. G. Dromey, “How to Solve It By Computer”, Pearson, 1982
• A.R. Bradley, “Programming for Engineers”, Springer, 2011
• Kernighan and Ritchie, “The C Programming Language”, (2nd ed.) Prentice Hall, 1988