Embed
Email

Review

Document Sample

Shared by: xiang
Categories
Tags
Stats
views:
0
posted:
11/8/2011
language:
English
pages:
26
CSE-102: Programming

Fundamentals

1



Lecture (Last)

Review Class

CSE-102

2



 Course Code: CSE-102

 Course Title: Programming Fundamentals

 Credit: 3

 Lecture: 45

Syllabus

3



 Introduction of Computer Programming, Problem solving techniques, algorithm

specification and development, Programming style, debugging and testing,

documentation. Program design methodologies, structured and modular program

design.

 Programming Language in C: Introduction to C, programming file structure:

purpose of .h and .c files, Simple Makefile, constant, variable and data types,

operator and expression, type conversion, decision making, branching and looping,

arrays and strings, user defined functions, structures and union, bit field and bit-

wise operations, pointer, file management in C, command line arguments, dynamic

memory allocation and linked list, preprocessor, low level programming, managing

input/output operation.

 Unix Shell: shell command, filters, viewing file and statistics, comparing and

sorting, pipe, text processing, regular expression, grep family, stream edit with sed.

 Shell Programming: variables, environment variables, built in variables, defining

words – quotes; test – string, number, file properties, Bolean operators; control

structure – if-then-else, case, while loop, for loop. Make: Managing large program,

Makefile, Makefile rules. Awk Programming: command line syntax, input, output,

pattern matching, expressions, control statements, built in variables, arrays, built in

functions, user define function

Introduction to C



 Standards: ANSI, ISO

 Machine language, Assembly language, low level

language, mid level language, high level language

 History of C

 ASCII Code

 Create, compile, link, execute a program (both in

windows and linux)

 Source: Chapter 1 (Deitel), Chapter 1 (HS), Lecture

Introduction to C Programming



 Simple C program

 Data types (integer, character, floating point number,

double, void)

 Size of data types

 Datatype Modifiers

 Long, short, signed, unsigned

 size and range

 Keywords, identifiers, variables

 Constants

 Signed, unsigned, character, string, floating point numbes,

hexadecimal number, octal number

 Comments

Operators



 Arithmetic Operator

 Integer division, modulus



 Relational Operator

 Logical Operator

 Assignment Operator

 Increment decrement operator

 a++ vs. ++a



 Equality vs. assignment operator

Type Conversion

7



 Type Conversion / Type Casting

 implicit type conversion



 explicit type conversion

IO Operation

8



 Printf(), scanf(), getchar(), gets(), putchar(), puts(),

getch()

 Output Formatting:

 printf(“%5d %-5d %.2f %5.2f %5s”….);

 Input Formating:

 scanf(“%d - %d %[^\n]”…);



 Using %d, %s, %u, %f, %c, %p, …

Conditional Statement



 If

 If-else

 If-elseif-else

 Switch – case

 Keywords: switch, case, default



 ?:

Loop



 While

 Do – while

 For

 Break & continue statement

 exit() function

Function



 Function Definition

 Function Prototype

 Calling Function

 Call by value, Call by reference

 Local variable vs. global variable vs. formal

parameter

 Library Function

 Math Library

 String library

Storage Class



 Auto variable

 Register variable

 Extern variable

 Static variable

 Scope and life time of a variable

 Local variable vs. Global variable vs. External

variable vs. Static variable vs. Register variable

Array



 Defining array

 Initializing array

 Accessing array elements

 Array bounds

 Passing array to functions

 Multidimensional array

 Assigning vs. Initializing array elements

C Characters and Strings



 Character array vs. String

 Importance of a NULL(„\0‟) character in a string

 Determine the length of a string

 Copy, compare, search without using library

functions

 Library functions:

 strcpy, strcat, strcmp, strlen, strchr, strstr

 Isdigit, isalpha, isalnum, islower,isupper, tolower, toupper,

isspace,

 atoi, atof, atol

 sprintf, sscanf

C Pointers



 Pointer variable definition

 Pointer variable Initialization

 Pointer Operator

 Use pointers with arrays

 Use pointers in a function (Call by reference)

 Array of pointers

 Indirect reference

C Structure & Union



 Structure & Union

 Definition



 Accessing members



 Initializing



 Determine size



 typedef keyword



 Passing to a function and return from a function



 Pointer and array



 Operators (. , ->)



 Similarity and Difference between them

File Operation

17



 Stream

 Open a file in various mode

 Create a file

 Close a file

 Read from a file and write to a file

 Functions related to file operation

 fopen(), fclose(), fscanf(), fprintf(), fgetc(), fputc(), fgets(),

fputs(), fread(), fwrite()

Command line argument

18



 Command line argument

 int main (int argc, char *argv[])



 Importance of return value of a main function

Dynamic Memory Allocation and Linked List

19



 Important Function for dynamic memory allocation

 malloc, free, sizeof



 Linked list

 Create a node



 Insert a node at the beginning, at the end, in the middle



 Delete a specific node, last node, first node



 Traverse a linked list, Find data in a linked list

Preprocessor & macro

20



 What is it

 Two preprocessors commonly used

 #define



 #include



 Working with multiple files

Bitwise Operation

21



 Why is it important?

 Operators: >>, <<, !, &, ^, ~

 Multiply/division by 2 using bitwise operator.

 Set a specific bit (or, sequence of bits) to 1 or 0

 Check a specific bit (or, sequence of bits) whether it

is 0 or 1.

 Toggle any bit or sequence of bits

Recursion



 Recursion vs. Iteration

 Example:

 Factorial, Fibonacci number, Find the largest number, Tower

of Hanoi

 Determine the output of a recursive function

 Chapter 5 (Deitel)

Sort

23



 Sort an array of integers/characters

Linux Shell

24



 Common shell Commands (important list of commands

are given in course website)

 Shell Script

 How to make a shell script executable

 Echo, read

 Uses of Quotes (back quote, single quote, double quote)

 Variables, built-in variables.

 Comparison

 String compare, numerical value compare, file properties compare

 Conditional statements:

 If, if-elif-fi,

 Loop

 while, for

Question Patterns

25



 5 Questions from C programming

 2 questions from Shell & Shell Scripting

26





THANK YOU TO ALL



Related docs
Other docs by xiang
The Parable of the Rich Fool
Views: 23  |  Downloads: 0
14838-Nat.Equest Summer 08-2
Views: 7  |  Downloads: 0
kompendium_februar_01
Views: 1  |  Downloads: 0
Antimikrobielle Wirkung ausgewhl
Views: 2  |  Downloads: 0
Vietnamese BULLETIN vietnamien
Views: 1  |  Downloads: 0
Information Retrieval Models and
Views: 19  |  Downloads: 0
Download our Menu - Aveda Institutes
Views: 2  |  Downloads: 0
Journ茅e mondiale de l'hydrograph
Views: 2  |  Downloads: 0
SJSAS
Views: 0  |  Downloads: 0
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!