Sunteți pe pagina 1din 12

Lovely Professional University,Punjab

Format For Instruction Plan [for Courses with Lectures and Labs

Course No CSE101

Cours Title FOUNDATIONS OF COMPUTING

Course Planner 12237 :: Parul Khurana

Lectures Tutorial Practical Credits 3 0 4 5

Text Book:

1 Programming With C, by Byron Gottfried, Publishers: Tata McGraw-Hill, Second Edition

Other Specific Book:

2 Programming with ANSI & Turbo C, by Ashok N. Kamthane, Publishers: Pearson Education 3 The C Programming Language, by B.W. Kernighan and D.M. Ritchie, Publishers: Prentice Hall of India, New Delhi 4 Programming in ANSI C, by E.Balagurusamy, Publishers: Tata McGraw Hill Publishing Company Limited, New Delhi 5 Computer science A structure programming approach Using C, by Behrauz A.Foruzan & Richard F.Gilberg, Publishers: Thomson Asia, 2001 6 Computer Fundamentals, by P.K. Sinha & Preeti Sinha, Publishers: BPB Publications

Other Reading Sr No Jouranls atricles as compulsary readings (specific articles, Complete reference) 7 http://cplus.about.com/od/thecden/Welcome_to_the_C_Area_with_Articles_about_C_Development.htm 8 http://www.programmersheaven.com/tags/C/ Relevant Websites Sr. No. (Web adress) (only if relevant to the courses) 9 www.cprogramming.com/ 10 http://www.howstuffworks.com/c.htm 1 Salient Features A website designed to help you learn C or C++. Understandable C and C++ programming tutorials, compiler reviews, source code, tips and tricks. Learn how to write computer programs in C. Approved for Spring Session 2010-11

11 http://cprogramminglanguage.net/

C Programming Language website gives you a lot of helpful resources which help you to learn C programming.

Detailed Plan For Lectures


Week Number Lecture Number Lecture Topic Chapters/Sections of Homework to be Assigned Pedagogical tool Textbook/other to students Demonstration/case reference study/images/anmatio n ctc. planned

Part 1
Week 1 Lecture 1 Lecture 2 Lecture 3 Week 2 Lecture 4 Lecture 5 Problem Solving & Program Planning: Need for problem solving and planning a program Program design tools: algorithms, flow charts Pseudo codes and decision tables Basics of C Language: Phases in the development of a program, Compilers & Interpreters Declarations: Character Set, delimiters, keywords, identifiers, constants, variables. ->Reference :6,Chapter11 ->Reference :1,1Chap2(Pg2.1-2.5) ->Reference :1,1Chap2(Pg2.142.24) ->Reference :1,1Chap2(Pg2.122.14) ->Reference :1,1Chap2(Pg2.252.28) HomeWork 1 Allocation ->Reference :6,Chapter11

Lecture 6

Data types, declaring & Initializing variables, Type Conversion

Week 3

Lecture 7 Lecture 8 Lecture 9

Operators & Expressions: Various operators, Precedence & Associativity

->Reference :1,1Chap3 Term Paper 1 Allocation (Pg3.1-3.21)

Handling Input/Output: Unformatted & Formatted I/O ->Reference :1,1Chap4 (Pg4.1-4.29) Decision making statements if, else if Control Statements: For, Do while, while, ->Reference :1,1Chap6 (Pg6.2-6.9) ->Reference :1,1Chap6 (Pg6.9-6.33)

Week 4

Lecture 10

Approved for Spring Session 2010-11

Part 2
Week 4 Lecture 11 Lecture 12 Week 5 Lecture 13 Control transfer statements - break, continue. Functions: Defining and accessing a function, Function prototypes Functions & Introduction to Pointers: Passing arguments call by value Declaring and initializing pointers; call by address ->Reference :1,1Chap6 HomeWork 2 Allocation (Pg6.42-6.47) ->Reference :1,1Chap7 HomeWork 1 Submission (Pg7.1-7.20) ->Reference :1,1Chap7 (Pg7.20-7.26) ->Reference :1,1Chap10(Pg10.510.16) ->Reference :1,1Chap7 (Pg7.26-7.33)

Lecture 14

Lecture 15 Week 6 Lecture 16 Lecture 17 Lecture 18

Recursive functions.

Arrays: Defining arrays ;declaration and initialization ->Reference :1,1Chap9 of arrays (Pg9.1-9.7) I/O & Processing of arrays Dynamic memory Allocation, memory leak ->Reference :1,1Chap9 (Pg9.7-9.10) ->Reference :1,1Chap10(Pg10.2010.23) ->Reference :1,1Chap9 (Pg9.10-9.24) ->Reference :1,1Chap9(Pg9.329.35) ->Reference :4,4Chap8(Pg8.1-8.8) ->Reference :1,1Chap9 (Pg9.32-9.35) HomeWork 2 Submission

Week 7

Lecture 19 Lecture 20

Arrays & Functions: Passing array to a function Arrays and Strings; built-in library functions to manipulate strings

Lecture 21

Array of strings, passing strings to a function

MID-TERM Part 3
Week 8 Lecture 22 Structures: Defining and processing structures, Declaring a structure (globally and locally) Memory requirement of structure, inputting/ outputting & processing using structures Structures & Unions: Array of structures, nested structures ->Reference :1,1:Chap11(Pg11.111.7) ->Reference :1,1:Chap11(Pg11.811.20) ->Reference HomeWork 3 Allocation :3,3:Chap6(Pg6.1-6.3) Approved for Spring Session 2010-11

Lecture 23

Lecture 24

Week 9

Lecture 25

Self-referential Unions; union of structures; bit-fields. ->Reference :1,1:Chap11(Pg11.111.6) ->Reference :1,1:Chap13(Pg13.1713.27) Pointers: pointer arithmetic ->Reference :1,1:Chap10(Pg10.2310.26) ->Reference :1,1:Chap10(Pg10.1610.19) ->Reference :1,1:Chap11(Pg11.2411.41) ->Reference HomeWork 4 Allocation :1,1:Chap8(Pg8.1-8.11)

Lecture 26

Lecture 27

Array & Pointers, pointers and strings

Week 10

Lecture 28

Pointers and structures; Pointers and functions

Lecture 29

Storage Classes: Storage classes and their usage, concept of scope ,visibility and lifetime of variables

Part 4
Week 10 Week 11 Lecture 30 Lecture 31 Local & global variable/function declaration Various storage classes(Automatic and Register class) ->Reference HomeWork 3 Submission :1,1:Chap8(Pg8.2-8.11) ->Reference :1,1:Chap8(Pg8.2-8.5) ->Reference :1,1:Chap13(Pg13.113.4) ->Reference :1,1:Chap8(Pg8.5-8.15) ->Reference :1,1:Chap12(Pg12.112.11) ->Reference :1,1:Chap12(Pg12.112.11) Term Paper 1 Submission

Lecture 32 Lecture 33

Static and External storage class File handling: Opening a file, file opening modes

Week 12

Lecture 34

Reading from and writing to files

Lecture 35

Manipulating file pointers using fseek(), rewind() and ->Reference ftell() functions :4,4:Chap12(Pg12.112.6) Random accessing files, file Updation HomeWork 4 Submission

Lecture 36

Approved for Spring Session 2010-11

Week 13

Lecture 37

Managing multi file programs and projects: making executable files Creating your own library files and header files

->Reference :1,1:Chap2(Pg2.102.12) ->Reference :1,1:Chap14(Pg14.114.7) ->Reference :1,1:Chap14(Pg14.1214.21)

Lecture 38

Lecture 39

Adding user defined functions in existing library.

Spill Over
Week 14 Lecture 40 Enumerations ->Reference :1,1:Chap14(Pg14.114.7) ->Reference :1,1:Chap14(Pg14.814.11) ->Reference :1,1:Chap14(Pg14.1114.12) ->Reference :1,1:Chap14(Pg14.1214.21)

Lecture 41

Command Line Parameters

Lecture 42

More About Library Functions

Week 15

Lecture 43

Macros

Details of homework and case studies


Homework No. Homework 1 Topic of the Homework Nature of homework (group/individuals/field work

Problem Solving & Program Planning: Need for problem solving and planning a program, Program design Individual tools - algorithms, flow charts, pseudo codes and decision tables, Basics of C Language: Phases in the development of a program, Compilers & Interpreters Declarations: Character Set, delimiters, keywords, identifiers, constants, variables, data types, declaring & Initializing variables. Operators & Expressions: Various operators, precedence & Associativity, Type Conversion Handling Input/output: Unformatted & Formatted I/O Decision making statements if, else if. Control Statements: For, do while, while, Control transfer statements - break, continue. Functions: Defining and accessing a function Functions & Introduction to Pointers: Passing arguments call Individual by value, Declaring and initializing pointers; call by address, function prototypes, recursive functions. Arrays: Defining arrays; declaration and initialization of arrays, I/O & Processing of arrays, Dynamic memory Allocation, memory leak Arrays & Functions: Passing array to a function; Arrays and Strings; built-in library functions to manipulate strings, array of strings, passing strings to a function.

Homework 2

Approved for Spring Session 2010-11

Homework 3

Structures: Defining and processing structures, declaring a structure (globally and locally), memory Individual requirement of structure, inputting/ outputting & processing using structures. Structures & Unions: Array of structures, nested structures, self-referential Unions; union of structures; bit-fields. Pointers: pointer arithmetic; Array & Pointers, pointers and strings; pointers and structures; pointers and functions Dynamic memory Allocation. File handling: Opening a file, file opening modes, reading from and writing to files, manipulating file pointers using fseek(), rewind() and ftell() functions, random accessing files, file updation. Storage Classes: Storage classes and their usage, concept of scope, visibility and lifetime of variables, local & global variable/function declaration, various storage classes (Automatic, Register, Static and External storage class). Managing multi file programs and projects: making executable files, creating your own library files and header files, adding user defined functions in existing library. Individual

Homework 4

Scheme for CA:out of 100*


Component Term Paper Lab Assesment Homework Class test based on homework Frequency 1 10 3 3 Total :4 4 Out Of Each Marks Total Marks 25 3 5 10 43 25 30 15 30 100

* In ENG courses wherever the total exceeds 100, consider x best out of y components of CA, as explained in teacher's guide available on the UMS List of suggested topics for term paper[at least 15] (Student to spend about 15 hrs on any one specified term paper) Sr. No. Topic 1 Scientific calculator 2 Digital Calendar 3 Mobile Service provider database 4 University Management System 5 Employee Details 6 Salary Slip Generation 7 Expenses Calculator 8 Hardware Management System 6 Approved for Spring Session 2010-11

9 C Programming Database 10 Books Sale and Purchase System 11 Attendance Record System 12 Examination Seating Plan System 13 Paper Setter System 14 Parking Record System 15 Gate Pass Generation System

*Each experiment of the lab will be evaluated using following relative scheme:
Component VIVA WR J/E % of Marks 30 20 50

List of experiments :Lecture Number Lecture Topic Pedagogical Tools Or Equipment Planned lab Manual

Implementatio Write an algorithm to perform Arithmetic Operations on PC / Turbo C /Projector n1 two numbers. Implementatio Draw a flowchart to perform Arithmetic Operations on n2 two numbers. PC / Turbo C /Projector

Implementatio Write a pseudo code to perform Arithmetic Operations PC / Turbo C /Projector n3 on two numbers. Implementatio Write a program to perform Arithmetic Operations on n4 two numbers. Implementatio Write a program to use four basic data types of C. n5 Implementatio Write a program to demonstrate the concept of n6 constant and variable. Implementatio Write a program to demonstrate different types of n7 operators in C with their precedence level. Implementatio Write a program to demonstrate the purpose of n8 different formatted and unformatted I/O functions. 7 PC / Turbo C /Projector PC / Turbo C /Projector PC / Turbo C /Projector PC / Turbo C /Projector PC / Turbo C /Projector

Approved for Spring Session 2010-11

Implementatio Write a program to demonstrate two different types of n9 branching. Implementatio Write a loop that will calculate the sum of every third n 10 integer, beginning with i=2( i.e calculate the sum 2+5+8+11+ .....) for all values of i that are less than 100. Write the loop in three different ways. Implementatio Write an interactive C program that will convert a n 11 positive integer quantity to a roman numeral.(e.g. 12 will be converted to XII). Design the program so that it will execute repeatedly, until a zero is read in from the keyboard.

PC / Turbo C /Projector PC / Turbo C /Projector

PC / Turbo C /Projector

Implementatio Write a complete C program that will calculate the real PC / Turbo C /Projector n 12 roots of the quadratic equation: ax2 + bx + c =0 Implementatio Write a function that will allow a floating-point number n 13 to be raised to an integer power. In other words, we wish to evaluate the formula y=xn. Where x and y are floating point variables and n is an integer variable. Implementatio Write a program which declares two pointers whose n 14 objects are the integer variables i and j. PC / Turbo C /Projector

PC / Turbo C /Projector

Implementatio Write a program which includes a recursive function to PC / Turbo C /Projector n 15 determine the cumulative sum of n floating-point numbers. Read a new number into the computer during each call to the recursive function. Implementatio Write an interactive C program to process the exam PC / Turbo C /Projector n 16 scores for a group of students in a C programming course. Begin by specifying the number of exam scores for each student and then each students name and roll number. Calculate an overall class average and display with follow by name and roll no. Implementatio Write an interactive C program that will simulate a n 17 game of Bingo, print each letter-number combination as it is drawn (randomly generated). Be sure that no combination is drawn more than once. PC / Turbo C /Projector

Implementatio Write a program that processes a multiple lines of text. PC / Turbo C /Projector n 18 First enter and store a multiple lines of text and then determine the number of vowels, consonants, digits, whitespace characters and other characters for each line. Finally determine the average number of vowels per line, consonants per line, etc. Write and execute the program with the help of two dimensional arrays of characters.

Approved for Spring Session 2010-11

Implementatio Write a function in C that will enter the line of text, store PC / Turbo C /Projector n 19 it in array and then display it backwards. Allow the length of the line to be unspecified (terminated by pressing the Enter key), but assume that it will not exceed 80 characters. Implementatio Write a function in C that will generate a table of values PC / Turbo C /Projector n 20 for the equation: y= 2e-0.1t sin 0.5 t Where t varies between 0 and 60. Allow the size of the t-increment to be entered as an input parameter. Implementatio Write an interactive C program that will accept the n 21 name of a country as input and display the corresponding capital, and vice versa. Design the program so that it executes repeatedly, until the word End is entered as input. PC / Turbo C /Projector

Implementatio Write an interactive C program that will encode or PC / Turbo C /Projector n 22 decode a line of text. To encode a line of text, convert each character, including blank to its ASCII equivalent. Implementatio Read in the first m elements of a one-dimensional n 23 floating-point array. Calculate the sum of these elements, the mean, the deviations, and the standard deviation, the algebraic maximum and algebraic minimum. PC / Turbo C /Projector

Implementatio Suppose A is a table of floating point numbers having k PC / Turbo C /Projector n 24 rows and m columns and B is a table of floating point numbers having m rows and n columns. We wish to generate a new table, C , where each element of C is determined by: C[i][j]=A[i][1] * B[1][j] + A[i][2] * B[2][j] + .....+ A[i][m] * B [m][j].

Mid Term
Implementatio Define a structure that contains the following two n 25 members: a. an integer quantity called won b. an integer quantity called lost c. a floating-point quantity called percentage d. a 40-element character array called name Include the user-defined data type team within the definition PC / Turbo C /Projector

Approved for Spring Session 2010-11

Implementatio Declare a variable t to be a structure variable of type n 26 team as described in problem 25. Now however initialize t as follows: Name: INDIA Won: 20 Lost: 2 Percentage: 90.9

PC / Turbo C /Projector

Implementatio Write a program that will display the size of the PC / Turbo C /Projector n 27 memory block associated with the variable t which was described in problem #26. Implementatio Define a structure of type hms containing three integer PC / Turbo C /Projector n 28 members, called hour, minute and second, respectively. Then define a union containing two members, each a structure of type hms. Call the union members local and home respectively. Declare a pointer variable called time that points to this union. Implementatio Define a self referential structure containing the n 29 following three members: a. a30-element character array called name b. a structure named stats, of type team, as defined in problem #25 c. a pointer to another structure of this same type, called next PC / Turbo C /Projector

Implementatio Write a C program that will accept the following PC / Turbo C /Projector n 30 information for each team in a baseball or a football league: a. Team name, including the city b. Number of wins c. Number of losses For a baseball/football team, add the following information: d. Number of hits e. Number of runs f. Number of errors g. Number of extra inning games Enter this information for all of the teams in the league. Then reorder and print the list of teams according to their win-lose records. Implementatio Write a program for each of the following situations: n 31 a. Declare two pointers whose objects are the integer variables i and j b. Declare a pointer to a floating-point quantity and a pointer to a double precision quantity c. Declare a function that accepts two integer arguments and returns a pointer to a long integer. 10 PC / Turbo C /Projector

Approved for Spring Session 2010-11

Implementatio Write a program to declare a function that accepts PC / Turbo C /Projector n 32 another function as an argument and returns a pointer to a character. The function passed as an argument will accept an integer argument and returns an integer quantity. Implementatio Write a complete C program to implement vector n 33 multiplication using pointer notation in place of arrays. PC / Turbo C /Projector

Implementatio Write a complete C program, using pointer notation PC / Turbo C /Projector n 34 that will generate a table containing the following three columns: t aebt sin ct aebt cos ct Implementatio Write a program to calculate factorial of a number with PC / Turbo C /Projector n 35 the help of auto storage class. Implementatio Write a program to find the maximum value of number n 36 entered by the user in a specified interval of time. Implementatio Write a program to read several lines of text and n 37 determine the average number of characters per line. Implementatio Write a program to calculate successive Fibonacci n 38 numbers with the help of static storage class. Implementatio Write a program to display names of the students n 39 mentioned in another C file with the help of external variables. Implementatio Write a program to open the existing file for reading n 40 and writing employee information. Implementatio Write a program to demonstrate two different n 41 approaches of updating a file. Implementatio Write a file oriented C program that will save the n 42 student exam scores for n courses. Implementatio Write a program to read the data saved in problem n 43 #42. Then create a report containing the name, exam scores and average grade for each student. PC / Turbo C /Projector PC / Turbo C /Projector PC / Turbo C /Projector PC / Turbo C /Projector

PC / Turbo C /Projector PC / Turbo C /Projector PC / Turbo C /Projector PC / Turbo C /Projector

11

Approved for Spring Session 2010-11

Implementatio Write a complete C program that can be used a simple PC / Turbo C /Projector n 44 line oriented text editor. This program must have the following capabilities: a. Enter several lines of text and store in a data file b. List the data file c. Retrieve and display a particular line, determined by line number d. Insert n lines e. Delete n lines f. Save the newly edited text and end the computation. Carry out each of these tasks in response to a one letter command, preceded by a dollar sign.

Spill Over
Implementatio Write a program that will concatenate two files; that is, PC / Turbo C /Projector n 45 append the contents of one file at the end of another and write the result into a third file. You must be able to execute the command at DOS prompt as follows: C>Concat source1.txt source2.txt target.txt Implementatio Write a program which prints out only those lines from n 46 a file which are containing more then 80 character. Also print out the line numbers of these lines. PC / Turbo C /Projector

12

Approved for Spring Session 2010-11

S-ar putea să vă placă și