WordPress.com



K L University

Department of Basic Engineering Sciences

Course Handout for Ist Year B.Tech PROGRAM

A.Y.2016-17, 1st Semester

Course Name  : Problem Solving & Computer Programming

Course Code  : 17CS1101 L-T-P structure : 2 4 2

Course Credits :05

Course Coordinator   : Dr. D. Haritha

Course Instructors            : 1. P.V.Vara Prasad 11. P Venkateswara Rao

2. T. Vamsidhar 12. T. Vijaya Saradhi

3. E. Sridevi 13. L. Jagjeevan Rao

4. T. Rajesh Kumar 14. R. Srikanth

5. L.Sridhar Rao 15. N. Sreeram

6. P. Siva Kumar 16. Pradeep Raj

7. G. Rama Krishna 17. V.Prema Latha

8. Zeelan Basha 18. Saibaba

9. Sk. Razia 19. Dorababu

10. Uday Kumar 20. NVS Pavan Kumar

21. D. Anand 22. T. Ganeshan

23. Syed Karimunisha 24. K. Suma Anusha

25. Sk. Razia 26.V. L. Sarvani

27. D.R. Lavanya 28.U Haritha

29. B. Ashok 30.ASALG Gupta

31. N. Swathi

Course Teaching Associates :A.Krishna, Sowmya Ranjan Jena, Avirup guha Neogi, Chandrasekhar Gosami, Sk. Shakeela, Ayushree, Prince Priya Malla, T. Pavithra.

Course Objective : The objective of the course is to equip the student with problem solving skills using C Language and associated Data Structures to provide the student details about algorithms used in typically familiar problems, and a few details about the essential ingredients of the programming language C and fundamental Data Structures.

Course Rationale: The course takes an imperative view of problem solving through programming using C programming language.. This necessitates data abstraction, basics of data structures, and an introduction to the GNU/Linux operating system and programming the medium level language C. Student is professionally trained in algorithms, flowcharts , analysis of a problem and translating the same into a C program. The students are made to write C programs on their own for sets of both mathematical and other engineering problems after exposing them to the different constructs of C language namely Input/output, assignments, iteration and control structures. Finally the student is acquainted with basic data structures like stacks, queues, lists etc.

Course Outcomes (CO):

|CO No: |CO |SO |BTL |

|1 |Illustrate how problems are solved using computers and programming. |a,e |2 |

|2 |Illustrate and use Control Flow Statements in C. |a,e, |2 |

|3 | Interpret & Illustrate user defined C functions and different operations on list of data. |a,e |2 |

|4 | Implement Linear Data Structures and compare them. |B |2 |

|5 |Apply the knowledge obtained by the course to solve real world problems. |a,b,e |2 |

COURSE OUTCOME INDICATORS (COI): ( 3 to 5 COIs per each CO are permitted except for Lab oriented CO, for Lab two COIs are normally permitted)

|CO No. |COI-1 |COI-2 |COI-3 |COI-4 |

|1 |Describe problem solving and how to |Understanding Data types in C |Illustrate different |. |

| |translate a flowchart to a C |language including Pointers . |types of Operators in | |

| |program. | |C. | |

|2 |Interpret & Solve Decision making |Solve problems by Decision making | | |

| |problems. |& Looping. | | |

|3 |Interpret user defined C functions, |Illustrate different operations on| | |

| |and understanding of storage classes|list of data including searching &| | |

| |and scope of variables |sorting techniques. | | |

|4 |Interpret user-defined data types & |Design and implement | | |

| |Illustrate different operations on |Algorithms for Linear Data | | |

| |Strings. |Structures | | |

|5 |Identify the problem |Analysis of the problem |Design |Implementation |

SYLLABUS (As approved by BoS):

Problem Solving Approach, Algorithms and Algorithm Analysis, Program Development Steps, Structure of C Program, Pre-Processor Directives, Formatted I/O,C Tokens, Data Types: Primitive, Extended and Derived Including Pointers, Operators, Precedence, Associativity , Redirecting I/O :Files and File Operations , Control Flow Statements, Functions, Recursion, Scope of Variables and Storage classes, Arrays, 2-DimensionalArrays,Dynamic Memory Allocation, Searching: Linear Search and Binary Search, Sorting: Bubble Sort, Strings, Structures and Unions, Introduction to Stacks-Implementation using array, Introduction to Queues - Linear Queue-Implementation using array, Introduction to Lists: Single Linked List- Insertion, Deletion, Display, Introduction to Trees- Binary tree, Definition, Terminology.

Text Books:

1. Brian W. Kernighan, Dennis M. Ritchie, “The C Programming Language: ANSI C Version”, 2/e, Prentice-Hall/Pearson Education-2005.

2. E. Balagurusamy , “Programming in ANSI C” 4th ed., Tata McGraw-Hill Education, 2008 .

3. R. F. Gilberg, B. A. Forouzan, “Data Structures”, 2nd Edition, Thomson India Edition-2005.

Reference Books:-

1. Mark Allen weiss, Data Structures and Algorithm Analysis in C, 2008, Third Edition, Pearson Education.

2. Horowitz, Sahni, Anderson Freed, “Fundamentals of Datastructures in C”, 2nd Edition-2007.

3. Robert Kruse, C. L. Tondo, Bruce Leung, Shashi Mogalla, “Data structures and Program Design in C”, 4th Edition-2007.

4. C for Engineers and Scientists – An Interpretive Approach by Harry H. Cheng, Mc Graw Hill International Edition-2010.

5. Jeri R. Hanly, Elliot B. Koffman, “Problem Solving and Program Design in C”, 7/e, Pearson Education-2004.

6. Jean Paul Trembly Paul G.Sorenson, “An Introduction To Data Structures with applications”, 2nd Edition.

Other Books, References: (As recommended for reference by the course team, if any): Nill

Deviations (if any) from BoS approved syllabus and the topics planned: Nill

(Clearly state each deviation and give brief explanation on justifying the deviation)

COURSE DELIVERY PLAN:

|Sessio.|CO |COI |Topic (s) |Teaching-Learning |Evaluation |

|No. | | | |Methods |Components |

|1 |1 |1 |Introduction, Algorithms and flowcharts. |Chalk & talk |Test-1/SEE/ LTC- |

| | | | | |TEST |

|2 | |1 |Algorithms and flowcharts. |Chalk & talk |Test-1/SEE/ LTC- |

| | | | | |TEST |

|3 | |1 |Algorithm analysis |Chalk & talk |Test-1/SEE/ LTC- |

| | | | | |TEST |

|4 | |2 |Introduction to C programming language-structure of C & |Chalk & talk |Test-1/SEE/ LTC- |

| | | |formatted I/O. [T1- PP.1-46] | |TEST |

|5 | |2 |Basics of C Language - Tokens. [T1- PP.1-46] |Chalk & talk |Test-1/SEE/ LTC- |

| | | | | |TEST |

|6 | |2 |Data Types[T1- PP.1-46] |Chalk & talk, ppt |Test-1/SEE/ LTC- |

| | | | | |TEST |

|7 | |2 |Data Types[T1- PP.1-46] [LTC EVALUATION] |Chalk & talk |Test-1/SEE/ LTC- |

| | | | | |TEST |

|8 | |2 |Redirecting I/O – Files & File Operations . |Chalk & talk |Test-1/SEE/ LTC- |

| | | | | |TEST |

|9 | |3 |Arithmetic, relational, and logical operators. [T1- |Chalk & talk |Test-1/SEE/ LTC- |

| | | |PP.52-59] | |TEST |

|10 | |3 |Increment and decrement operators, conditional, assignment and |Chalk & talk |Test-1/SEE/ LTC- |

| | | |special operators[T1- PP.61-63]. [LTC EVALUATION] | |TEST |

|11 | |3 |Special Operators, Operators precedence, operators |Chalk & talk |Test-1/SEE/ LTC- |

| | | |associativity, Expression evaluation rules [T1- PP.64-72] | |TEST |

|12 | |3 |Bit- wise operators. [T1- PP.52-59] |Chalk & talk |Test-1/SEE/ LTC- |

| | | | | |TEST |

|13 |2 |1 |Simple-if and if-else statement[T1- PP.114-119] |Chalk & talk |Test-2/SEE/ LTC- |

| | | | | |TEST |

|14 | |1 |Else-if ladder statement[T1- PP.126-128] [LTC EVALUATION] |Chalk & talk |Test-2/SEE/ LTC- |

| | | | | |TEST |

|15 | |1 |Nested – If and Switch case statement[T1- PP.129-132] [LTC |Chalk & talk |Test-2/SEE/ LTC- |

| | | |EVALUATION] | |TEST |

|16 | |2 |While loop statement[T1- PP.154-156] [LTC EVALUATION] |Chalk & talk |Test-2/SEE/ LTC- |

| | | | | |TEST |

|17 | |2 |While loop statement[T1- PP.154-156] [LTC EVALUATION] |Chalk & talk |Test-2/SEE/ LTC- |

| | | | | |TEST |

|18 | |2 |For loop statement[T1- PP.159-170] [LTC EVALUATION] |Chalk & talk |Test-2/SEE/ LTC- |

| | | | | |TEST |

|19 | |2 |For loop statement[T1- PP.159-170] |Chalk & talk |Test-2/SEE/ LTC- |

| | | | | |TEST |

|20 | |2 |Do-while loop statement[T1- PP.157-158] |Chalk & talk |Test-2/SEE/ LTC- |

| | | | | |TEST |

|21 |3 |1 |Functions –Basic concepts, Types, Categories of functions[T1- |Chalk & talk |Test-3/SEE/ LTC- |

| | | |PP.262-287] [LTC EVALUATION] | |TEST |

|22 | |1 |Functions – function pointer, call by value and call by |Chalk & talk |Test - 3/SEE/ LTC- |

| | | |reference.[T1- PP.262-287] | |TEST |

|23 | |1 |Recursive Function – Introduction, Examples[T1- PP288-289] [LTC |Chalk & talk, |Test - 3/SEE/ LTC- |

| | | |EVALUATION] |visualization |TEST |

|24 | |1 |Recursive Function – practice [T1- PP288-289] |Chalk & talk, |Test - 3/SEE/ LTC- |

| | | | |visualization |TEST |

|25 | |1 |Storage Classes – Introduction, Types, Examples[T1- PP.295-303] |Chalk & talk |Test - 3/SEE/ LTC- |

| | | | | |TEST |

|26 | |2 |Arrays – 1 Dimensional array [T1- PP.192-198, T3- PP.597-600] |Chalk & talk |Test - 3/SEE/ LTC- |

| | | |[LTC EVALUATION] | |TEST |

|27 | |2 |Arrays – pointer to an array, array of pointers [T1- PP.192-198,|Chalk & talk |Test - 3/SEE/ LTC- |

| | | |T3- PP.597-600] | |TEST |

|28 | |2 |Arrays – 2 Dimensional array [T1- PP.199-208] [LTC EVALUATION]. |Chalk & talk |Test - 3/SEE/ LTC- |

| | | | | |TEST |

|29 | |2 | Linear search [T1- PP.192-198, T3- PP.597-600] |Chalk & talk |Test - 3/SEE/ LTC- |

| | | | | |TEST |

|30 | |2 |Binary search [T1- 603-607] [LTC EVALUATION] |Chalk & talk |Test - 3/SEE/ LTC- |

| | | | | |TEST |

|31 | |2 |Sorting on numeric data– Bubble sort[T3- PP.558-560] [LTC |Chalk & talk |Test - 3/SEE/ LTC- |

| | | |EVALUATION] | |TEST |

|32 |4 |1 |Operations on Strings[T1- PP.229-241] |Chalk & talk |Comprehensive end |

| | | | | |exam |

|33 | |1 |Operations on Strings & string pointers[T1- PP.242-250] |Chalk & talk |Comprehensive end |

| | | | | |exam |

|34 | |1 |Introduction to structures[T1- PP.317-326] |Chalk & talk |Comprehensive end |

| | | | | |exam |

|35 | |1 |Structures and structure pointers and unions. [T1- PP.317-326] |Chalk & talk, ppt |Comprehensive end |

| | | | | |exam |

|36 | |2 |Implementation of stacks using arrays.[T3-PP.79-82] |Chalk & talk, ppt |Comprehensive end |

| | | | | |exam |

|37 | |2 |Implementation of stacks using arrays. [T3-PP.79-82] [LTC |Chalk & talk |Comprehensive end |

| | | |EVALUATION] | |exam |

|38 | |2 |Implementation of queues using arrays[T3- PP.148-151] |Chalk & talk |Comprehensive end |

| | | | | |exam |

|39 | |2 |Sll node structure definition[T3- PP.193-197,214] |Chalk & talk |Comprehensive end |

| | | | | |exam |

|40 | |2 |Implementation of single linked list[T3- PP.197-202,216-219] |Chalk & talk |Comprehensive end |

| | | |[LTC EVALUATION] | |exam |

|41 | |2 |Introduction to Trees |Chalk & talk |Comprehensive end |

| | | | | |exam |

Session wise Teaching – Learning Plan

SESSION PLAN: 01

Session Outcome: At the end of this session on INTRODUCTION, ALGORITHMS AND FLOWCHARTS, Students will be able:

1. To write algorithms for linear problems.

2. To write flowcharts for linear problems.

|Time in Minutes |Topic |BTL |Teaching Methodology |

|5 |Recap/Introduction: | | |

| |Introduction about the need of C&DS course | | |

|20 |Sub-topic-1 (Lecture) |1 | |

| |Course handout discussion:- | | |

| |Regarding Syllabus and text books, evaluation pattern, division of course competencies,| | |

| |regarding lab taken to class evaluation procedure. | | |

|20 |Sub-topic-2 (Lecture) |1 |Chalk & talk |

| |What is a flowchart and Algorithm? And its need in s/w development. How to draw | | |

| |flowchart and how to design an algorithm for a given application (or program)? | | |

| |Example program: Write an algorithm and draw flowchart to withdraw cash from ATM | | |

|25 |Practice-session-1: |2 | |

| |Draw flowchart& algorithm to illustrate the following. Vishnu Limited calculates | | |

| |discounts allowed to customers on the following basis: | | |

| |Order quantity | | |

| |Normal discount | | |

| | | | |

| |1-99 | | |

| |5% | | |

| | | | |

| |100-199 | | |

| |7% | | |

| | | | |

| |200-499 | | |

| |9% | | |

| | | | |

| |500 and above | | |

| |10% | | |

| | | | |

|25 |Practice-session-2: | | |

| |Draw flowchart& algorithm to describe the process of solving the following problem. | | |

| |Rahul went to the grocery store and bought 1kg maida for 65Rs, 1 litre milk for 50Rs, | | |

| |and a dozen eggs for 35Rs. He paid for the groceries 500Rs.bill. What was his change? | | |

|5 |Conclusion | | |

| |Home Assignment: | | |

| |A University has 3,000 students. These students are divided in four categories: (i) B.| | |

| |Tech (ii) M. Tech (iii) M.S. (iv) Ph.D. | | |

| |Draw a flow chart and algorithm for finding the percentage of the students in each | | |

| |category. | | |

| |A farmer has field which is B meters wide and L meters long. The field yields C cubic | | |

| |meters of grain per hectare ( 1 Hectare = 10,000 square meters ). The farmer has a | | |

| |number of rectangular tins, L1 meters long, B1 meters wide and H1 meters high to store | | |

| |the grain. | | |

| |The program should output, | | |

| |(i) number of completely filled ins, | | |

| |(ii) volume of grain in the partially filled tin. Write algorithm & flowchart. | | |

SESSION PLAN: 02

Session Outcome: At the end of this session on ALGORITHMS AND FLOWCHARTS, Students will be able:

1. To design algorithms for iterative problems.

2. To design flowcharts for iterative problems.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction | | |

| |Recap previous class topic | | |

|30 |Sub-topic-1 (Lecture): |1 | |

| |Use an algorithm to print all natural numbers from 1 to N to make the | | |

| |students to understand design of algorithm and flow chart for iterative | | |

| |problems. | | |

|30 |Practice Session-1: |2 |Chalk & talk |

| |Ask the Students to do the following practicing problem. | | |

| |Write an algorithm and flowchart to print all even numbers between 1 to N | | |

| |Write an algorithm and flowchart to print sum of first N natural numbers. | | |

|30 |Practice Session-2: |2 | |

| |A company has 2,500 employees. Their salaries are stored as J(s), 1, 2, | | |

| |---- 2500. The salaries are divided in four categories as under : | | |

| |(i) Less than Rs. 1,000 (ii) Rs. 1,000 to Rs.2,000 | | |

| |(iii) Rs. 2,001 to Rs. 5,000 (iv) Above Rs. 5,000. | | |

| |Draw a flow chart for finding the percentage of the employees in each | | |

| |category | | |

|5 |Summary | | |

| |Home Assignment: | | |

| |A frog is at the bottom of a 30 meter well. Each day he summons enough | | |

| |energy for one 3 meter leap up the well. Exhausted, he then hangs there for| | |

| |the rest of the day. At night, while he is asleep, he slips 2 meters | | |

| |backwards. How many days does it take him to escape from the well? Note: | | |

| |Assume after the first leap that his hind legs are exactly three meters up | | |

| |the well. His hind legs must clear the well for him to escape | | |

| |P and Q are the two points of a graph. you are asked to find their | | |

| |Quadrant. Draw flow chart & algorithm . | | |

SESSION PLAN: 03

Session Outcome: At the end of this session on INTRODUCTION TO C LANGUAGE, Students will be able:

1. To know the structure of the C program

2. To Know the preprocessor directives and formatted IO.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction: | | |

|30 |Sub-topic-1(lecture): |1 |Chalk & talk |

| |Explanation of structure of C program with one example program- | | |

| |to find the area of a circle. | | |

|30 |Sub-topic -2(lecture) |2 | |

| |Explanation of preprocessor and directives with one example | | |

| |program – to find the potential energy of a body with a mass | | |

| |dropped from a height (Hint acceleration due to gravity | | |

| |g=9.8m/sec2) | | |

|30 |Sub topic-3(Lecture): | | |

| |Explanation of formatted I/O with the above 2 examples . | | |

|5 |Conclusion | | |

| | | | |

SESSION PLAN: 04

Session Outcome: At the end of this session on INTRODUCTION TO C LANGUAGE, Students will be able:

1. To know the character set of C Language.

2. To know the C tokens.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction: | | |

| |Explain brief history and characteristics of C programming | | |

|20 |Sub-topic-1(lecture): |1 |Chalk & talk |

| |Definition of compiler, interpreter, and their difference. | | |

|20 |Practice session - 1: |2 | |

| |Ask the students to write an algorithm to print their details | | |

| |(Registration form information). | | |

|20 |Sub topic-2(Lecture): | | |

| |Explanation of C character set, tokens, identifiers, keywords, | | |

| |operators, constants with possible examples. | | |

|30 |Sub-topic-3(Lecture): |1 | |

| |Explanation of tokens(keywords, identifiers, and constants) | | |

|5 |Conclusion | | |

| |Home Assignment: | | |

| |Write a C program that reads the last 3 digits of your roll | | |

| |number & Print it? | | |

| |Write a C program that reads your mobile number & display it | | |

| |along with your name? | | |

| |Write a C program to read employee number, name, salary and | | |

| |print it. | | |

Session Plan :5

Session Outcome: At the end of this session on DATA TYPES student will be able :

1. To understand the various data types and their usage.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap/Introduction: | | |

| |Recap | | |

|30 |Sub-task-1(Lecture): |1 |Chalk & talk |

| |Explanation of various primitive data types ( size and range of| | |

| |values). | | |

| |Explanation of input and output statements. | | |

|10 |Practice session-1: |2 | |

| |Ask the student to find the required data types to store age of| | |

| |a person, sex, mobile number and his weight in kgs(Eg.71.25 | | |

| |kgs). | | |

|10 |Practice session-2: |1 | |

| |Ask the student to display memory occupied by each primitive | | |

| |data type in their ascending order. | | |

|40 |Practice session-3: | | |

| |1)Ask the student to perform sum of two floating point numbers | | |

| |and display the sum in exponent format(Ex: | | |

| |13.3478+32.1234=0.4572E02) | | |

| |2)What is the output for the following: | | |

| |Void main() | | |

| |{ | | |

| |int m=12345; | | |

| |long int n=987654; | | |

| |printf(“%d\n”,m); | | |

| |printf(“%10d\n”,m); | | |

| |printf(“%010d\n”,m); | | |

| |printf(“%-10d\n”,m); | | |

| |printf(“%10ld\n”,n); | | |

| |printf(“%10ld\n”,-n);} | | |

| | | | |

| |3) What is the output for the following: | | |

| |void main() | | |

| |{float y=98.765; | | |

| |Printf(“%7.4f”,y); | | |

| |Printf(“%7.2f”,y); | | |

| |Printf(“%-7.2f”,y); | | |

| |Printf(“%f”,y); | | |

| |Printf(“%10.2e”,y); | | |

| |Printf(“%11.4e”,-y); | | |

| |Printf(“%-10.2e”,y); | | |

| |Printf(“%e”,y); } | | |

|5 |Summary | | |

Session Plan :6

Session Outcome: At the end of this session on DATA TYPES student will be able :

1. To understand the various data types and their usage.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap/Introduction: | | |

| |Recap all previous class operators | | |

|30 |Sub-task-1(Lecture): |1 |Chalk & talk |

| |Continue derived data types | | |

| |Introduction to pointers, explanation about the pointers and | | |

| |its usage with below example | | |

|15 |Practice session-1: |2 | |

| |Ask the student to find sum of two numbers using pointers. | | |

|15 |Practice session-2: |1 | |

| |Write the program with equivalent pointer expressions for the | | |

| |following: | | |

| | | | |

| | | | |

| |main() | | |

| |{ | | |

| |int u1; | | |

| |int v=3; | | |

| |u1=2*(v+5); | | |

| |printf(“\nu1=%d ”,u1); | | |

| |} | | |

| |2.predict the output for the following program segment: | | |

| |main() | | |

| |{ | | |

| |int i=2,*p; | | |

| |p=&I; | | |

| |printf(“%d %d %d”, I,*p++,*(p++)) | | |

| |} | | |

|20 |Sub -tesk-2(Lecture) | | |

| |Explanation of user defined data types(typedef,enum) | | |

|10 |Practice session-3: | | |

| |Ask the student to guess the output of following code segment | | |

| |Main() | | |

| |{ | | |

| |typedef int klu; | | |

| |klu a,b; | | |

| |a=20; | | |

| |b=30; | | |

| |printf(“%d”,a+b); | | |

| |} | | |

| | | | |

Session Plan :7

Session Outcome: At the end of this session on FILES student will be able :

1. To re direct input and output of a program to a file.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap/Introduction: | | |

| |Recap all previous class operators | | |

|45 |Sub-task-1(Lecture): |1 |Chalk & talk |

| |Explanation of use of files, different file | | |

| |operations(r,w,a+,w+),fopen(),fclose(),fscanf(),fprintf() | | |

|15 |Practice session-1: |2 | |

| |Ask the student to read two different numbers from the | | |

| |file(numbers.dat), with the help of the pointers calculate product | | |

| |of it and rewrite the result into the same file. | | |

|30 |Practice session-2: |1 | |

| |1)Ask the student to read their registration number from the | | |

| |keyboard and write it to a data file. | | |

| |2) Ask the student to create a file named “inventory.dat” that | | |

| |stores item name, quantity and price for a single item. write the | | |

| |program to read the values from the file and calculate bill amount | | |

| |and re write the same into the same file. | | |

|5 |Summary | | |

SESSION PLAN:8

Session Outcome: At the end of this session on OPERATORS, Students will be able:

1. To use arithmetic and relational operators in different C programs.

2. To write decision making C programs.

3. To use bitwise operators

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction: | | |

| |Explain the use of operators in C | | |

|25 |Practice session - 1: |2 | |

| |A computer programming contest requires teams of 5 members | | |

| |each. Write a program that asks for the number of players and | | |

| |then give the number of teams and number of players leftover? | | |

| | | | |

| |Ask the students to write either algorithm or program to find | | |

| |given number is positive or negative or zero number. | | |

|20 |Sub topic-1: |1 |Chalk & talk |

| |Explanation of arithmetic, relational and conditional operators| | |

| |with above problems. | | |

|25 |Practice session-2: |2 | |

| |Construct the logical expressions to represent the following | | |

| |conditions: | | |

| |Weight is greater than or equal to 115 but less than 225 | | |

| |X is even | | |

| |Donation is in the range 5000-7000 or guest is 1 | | |

| |Ch is a lower case letter. | | |

| | | | |

| |Ask the student to write algorithm and program to check that | | |

| |the given number is even or odd. | | |

|20 |Sub topic-2(Lecture): |1 |Chalk & talk |

| |Explanation of logical operators. Explain how to use pointers | | |

| |in expressions and possible arithmetic operations on pointers. | | |

|5 |Summary | | |

| |Home Assignment: | | |

| |Assume a vegetable market - selling vegetables Beetroot, | | |

| |Carrot, Onions, Tomato, Chillies, Ladies finger, Brinjal, | | |

| |CauliFlower, Cabbage, Leafy vegetables. Write a C program to | | |

| |Prepare the bill for each customer depending upon the choice of| | |

| |his/her purchase.(bill generation). | | |

| |Ask the student to write algorithm and program to swap two | | |

| |numbers without using temporary variable. | | |

| |Ask the students to write algorithm and program to find the | | |

| |given year is a leap year or not. | | |

| |Ask the students to write algorithm and program to calculate &| | |

| |display the remainder and quotient of a number?. | | |

SESSION PLAN: 9

Session Outcome: At the end of this session on OPERATORS, Students will be able:

1. To use increment and decrement operators in different programs.

2. To use assignment operators in different programs.

|Time in Minutes|Topic |Blooms Taxonomy Level-1|Teaching Methodology |

|5 |Recap / Introduction: | | |

|25 |Practice session-1: |2 | |

| |Ask the students to identify the output of the following code snippet | | |

| |int i=3,y,x=4; | | |

| |y = i++ + x; | | |

| |printf(“%d”,y); | | |

| |int i=3,y,x=4; | | |

| |y = ++i + x; | | |

| |printf(“%d”,y); | | |

| |int i=3,y,x=4; | | |

| |y = i++ + x + i; | | |

| |printf(“%d”,y); | | |

|15 |Sub task-1(Lecture): |1 |Chalk & talk |

| |Explain increment and decrement operators with above examples. | | |

|25 |Practice session-2: |2 | |

| |Ask the students to identify the output of following code snippet. | | |

| |void main() | | |

| |{ | | |

| |int a=5,b=6; | | |

| |(a>b)?printf(“%d”,a): printf(“%d”,b); | | |

| |} | | |

| | | | |

| |void main() | | |

| |{ | | |

| |Int a,b,c; | | |

| |clrscr(); | | |

| |a = 0XA4; | | |

| |b = 017; | | |

| |c = a*b; | | |

| |printf("\nthe product of a and b is:%d",c); | | |

| |} | | |

|15 |Practice session-3: |1 | |

| |What is the output for the following: | | |

| |void main() | | |

| |{ | | |

| |int a,b, *p1, *p2, x,y,z; | | |

| |a=12; | | |

| |b=4; | | |

| |p1=&a; | | |

| |p2=&b; | | |

| |x=*p1 * *p2 – 6; | | |

| |y=4 - *p2/*p1 +10; | | |

| |printf(“ address of a = %u\n”,p1); | | |

| |printf(“ address of b = %u\n”,p2); | | |

| |printf(“\n”); | | |

| |printf(“ a = %d, b=%d\n”,a,b); | | |

| |printf(“ x = %d, y=%d \n”,x,y); | | |

| |*p2 = *p2 + 3; | | |

| |*p1 = *p2 – 5; | | |

| |z = *p1 * *p2 - 6; | | |

| |printf(“ \n a = %d, b = %d \n”,a,b); | | |

| |printf(“ z= %d\n”,z); | | |

| |} | | |

| |Given the following declarations: | | |

| |int x=10, y = 10; | | |

| |int *p1 = &x, *p2=&y; | | |

| |what is the value of each of the following expressions? | | |

| |(*p1)++ | | |

| |–(*p2) | | |

| |*p1 + (*p2)-- | | |

| |++(*p2) - *p1 | | |

|5 |Summary | | |

| |Home Assignment: | | |

SESSION PLAN: 10

Session Outcome: At the end of this session on EXPRESSION EVALUATION RULES, Students will be able:

1. To understand the precedence and associativity of C operators

2. To evaluate the C expressions.

3. To use special operators.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap/Introduction: | | |

| |Recap all previous class operators | | |

|20 |Practice session – 1: | | |

| |find o/p of following: | | |

| | | | |

| |int a=20,b=30,res=0; | | |

| |res=(++a,b+=a); | | |

| |printf(“res=%d”,res); | | |

| | | | |

| |Void main() | | |

| |{ | | |

| |intp,q,r; | | |

| |p=3; | | |

| |q=4; | | |

| |r=0; | | |

| |r=(p++,q*=p); | | |

| |} | | |

| |What are the values of p,q,r after execution of above code | | |

| |segment? | | |

|20 |Sub – task-1(Lecture): | | |

| |Explain special operators. | | |

|15 | Practice session-2: |2 | |

| |Evaluate the following expression using BODMAS rule. | | |

| |7+(8%3)-12*30/6. | | |

| | | | |

| |2.find o/p of following: | | |

| |void main() | | |

| |{ | | |

| |inta,b=3; | | |

| |char c=’a’; | | |

| |a=b+c; | | |

| |printf(“%d\n”,a); | | |

| |} | | |

|15 |Sub-task-2(Lecture): |1 |Chalk & talk |

| |We will explain precedence and associativity of all operators | | |

| |in C. we will explain rules for expression evaluation. And also| | |

| |explain implicit and explicit type conversion. | | |

|20 |Practice session-3: | | |

| |Determine the data type of the expression | | |

| |(100(1-pq)/(q+r)) – (((p+r)/s)/(long(s+p))) | | |

| |Suppose a,b,c are integer variables where a=3,b=3,c=-5 and | | |

| |x,y,z are floating point variables where x=8.8, y=3.5, z=-5.2. | | |

| |determine the value of following expressions: | | |

| |a%c d. a*b/c | | |

| |(a*c)%b e. x/y | | |

| |x/(x+y) f. int(x) % int(y) | | |

| | | | |

| |Find the correct order of evaluation for the below expression. | | |

| |Z = x+y*z/4%2-1 | | |

| |Which of the following 2 statements are valid | | |

| |X=2,034; | | |

| |X=(2,034); | | |

|5 |Summary | | |

| |Home Assignment: | | |

| |Suppose x1 and x2 are two double type variables that you want | | |

| |to add as integers and assign to an integer variable. Construct| | |

| |a C statement for doing so? | | |

| |Given the following set of identifiers : | | |

| |char ch; short sh; int intval; long longval; float fl; | | |

| |identify the data type of the following expressions: | | |

| |‘a’-3 | | |

| |intval * longval – ch | | |

| |fl + longval/sh | | |

Session Plan :11

Session Outcome: At the end of this session on BIT WISE Operators student will be able :

1. To understand the operations

2. To evaluate the expression with bitwise operators

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap/Introduction: | | |

| |Recap all previous class operators | | |

|20 |Sub-task-1(Lecture): |1 |Chalk & talk |

| |Explanation of Bitwise operators(Bitwise AND,OR,NOT,XOR) | | |

|30 |Practice session-1: |2 | |

| |Ask the students to practice the following problems | | |

| |Void main() | | |

| |{ | | |

| |int a=27,b=39; | | |

| |printf(“a&b=%d”,a&b); | | |

| |printf(“a|b=%d”,a|b); | | |

| |printf(“~a=%d”,~a); | | |

| |printf(“~b=%d”,~b); | | |

| |} | | |

| |Swap two values by using XOR operators | | |

| |By assuming sample values for x and y evaluate | | |

| |(x.y)+(y.z)+(z.x)-(x.y) ^ (y-z)^(z-x) where . denotes bitwise| | |

| |AND + denotes bitwise OR , – means subtraction and ^ denotes | | |

| |bitwise XOR. | | |

|25 |Sub-task-2(Lecture): |1 | |

| |Explanation of Bitwise shift operators(left shift,right shift) | | |

|25 |Practice session-2: | | |

| |Ask the student to solve the following problems: | | |

| |Void main() | | |

| |{ | | |

| |int a=27,b,c; | | |

| |b=a3; | | |

| |printf(“b=%d,c=%d”,b,c); | | |

| |Ask the student how to double and half the values by using | | |

| |bitwise left shift and right shift operators. | | |

|5 |Summary | | |

SESSION PLAN: 12

Session Outcome: At the end of this session on SIMPLE-IF STATEMENTS, Students will be able:

1. To use simple conditional statements in real time applications

2. To write C programs using decision making.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap/Introduction: | | |

| |Recap all previous class operators | | |

|15 |Practice session-1: |2 | |

| |Ask the student to write an algorithm to illustrate the | | |

| |following. | | |

| |Indian Cricket Team went to toss with it’s opposite team | | |

| |captain. If India wins the toss display “India selected to | | |

| |bat” otherwise display “India selected to Field” as the | | |

| |message. | | |

|20 |Sub topic-1(Lecture): |1 |Chalk & talk |

| |Use the above problem to explain the syntax and execution | | |

| |flow of simple if and if-else statements. Discuss running | | |

| |time complexities. | | |

|30 |Practice session-1: |2 | |

| |Ask the student to practice the following program (with and| | |

| |without pointers) and also Find time complexity. | | |

| |To check given input character is vowel or consonant. | | |

| |Write a program to find whether the number can be divisible| | |

| |by both 5 and 3 or not. | | |

|20 |Practice session-2: | | |

| |Ask the student to write an algorithm to read input | | |

| |employee ID and his basic pay and then print employee ID, | | |

| |HRA and special allowance. Consider HRA is 20% of basic pay| | |

| |or Rs. 7000/- whichever is less and special allowance is | | |

| |10% of basic pay whenever basic pay exceeds Rs. 10000/-, | | |

| |otherwise it is 5% of basic pay. | | |

|5 |Recap | | |

| |Home Assignment: | | |

| |Write a program to find whether the given year is a leap | | |

| |year or not. | | |

| |Write a program to find given number is even number or odd | | |

| |number. | | |

SESSION PLAN: 13

Session Outcome: At the end of this session on NESTED IF-ELSESTATEMENT, Students will be able:

1. To solve multi decision problems.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction: | | |

|15 |Practice session-1: | | |

| |Ask student to write an algorithm for biggest of 3 numbers.| | |

|15 |Sub-Topic-1:(Lecture) |2 | |

| |Explanation of nested if else with Practice session-1 | | |

| |problem. | | |

|15 |Practice session-2: |2 | |

| |Ask the student to execute the practice session problem1. | | |

|15 |Practice session-3: |2 | |

| |Ask the student to write algorithm for following problems.| | |

| |Raja went to Trendset mall on x vehicle to buy dresses for | | |

| |his family. He parked the vehicle in malls paid parking | | |

| |area and completed shopping. After he returns he has to pay| | |

| |for the parking. Now you have to calculate the parking | | |

| |charges for the vehicle. Enter the type of the vehicle as a| | |

| |character(c for car, b for bike, a for auto).you have to | | |

| |read the hours and minutes when the vehicle enters the | | |

| |parking slot and when it is leaving. Write a C program to | | |

| |Calculate the total parking fees. The Trendset mall has | | |

| |fixed the rates as shown below.(Using nested if else) | | |

| |Vehicle name | | |

| |Rate till 3 hours | | |

| |Rate after 3 hours | | |

| | | | |

| |Truck/Auto | | |

| |20 | | |

| |30 | | |

| | | | |

| |Car | | |

| |10 | | |

| |20 | | |

| | | | |

| |Motorcycle/Scooter | | |

| |5 | | |

| |10 | | |

| | | | |

|30 |Ask the student to execute the problem in practice | | |

| |session-3. | | |

|5 |Summary | | |

| |Home Assignment: | | |

| |Write a program to read a C character from keyboard and | | |

| |then find out whether it is a vowel or consonant or digit | | |

| |or whitespace or special symbol. | | |

| |In a square shape play ground 4 food packets are placed at | | |

| |different positions P1, P2, P3 and P4. Two players A and B | | |

| |have started walking straight from different positions so | | |

| |that, to catch at least two food packets. | | |

| |Write an algorithm and flowchart to find is there any | | |

| |chance for them to continue their walking without touching | | |

| |together at any position in their walking path. If yes then| | |

| |give solution for given input positions P1, P2, P3 and P4. | | |

| |Write a program to read an integer and then find out | | |

| |whether it is positive or negative number or zero number. | | |

SESSION PLAN: 14

Session Outcome: At the end of this session on ELSE-IF LADDER STATEMENT, Students will be able:

1. To solve multi decision problems.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction: | | |

|20 |Practice session-1: |2 | |

| |Ask the student Write a program (using pointers) to read a | | |

| |positive number and then find out whether it is one digit | | |

| |number or 2-digit number or 3-digit number or 4-digit | | |

| |number or 5-ditgit number or other than these cases number.| | |

|10 |Sub topic-1(Lecture): |1 |Chalk & talk |

| |Use above program to make them to understand syntax of | | |

| |else-if ladder statement and its execution flow. | | |

|20 |Practice session-2: |2 | |

| |Ask the student to execute practice session-1 program in | | |

| |their laptops. | | |

|20 |Practice session-3: |2 | |

| |Ask the student to execute the following A number is | | |

| |special if it is divisible by 15. A number is big if it is | | |

| |greater than 999. A number is weird if it is divisible by 5| | |

| |and 6 but not 18. A number is scary if it is big or weird. | | |

| |Declare four variables called special, big, weird and scary| | |

| |and make suitable assignments to these variables as a | | |

| |number is tested . | | |

|10 |Practice session-4: | | |

| |Ask the student to write the algorithm to read an operator | | |

| |and then read its operands and then perform given operator | | |

| |operation on given values. | | |

|10 |Explain syntax of switch-case statement and its execution | | |

| |flow. | | |

|5 |Summary | | |

| |a program to print the name of a given decimal digit in | | |

| |their laptops. | | |

| |Write a menu driven program to perform a selected task from| | |

| |any one of the following tasks. | | |

| |Given number is even number or odd number | | |

| |Given year is a leap year or not. | | |

| |Given C character is a letter character or digit character | | |

| |or whitespace character or special symbol character. | | |

| |Find the biggest of given 3 numbers. | | |

| |Write a program to read a number from 1 to 12 and then | | |

| |display its corresponding month name. | | |

| |Write a program to read a number between 1 to 7 and then | | |

| |display its corresponding day name. | | |

| |Write a program to input a digit and print it in words? | | |

SESSION PLAN: 15

Session Outcome: At the end of this session on WHILE STATEMENT, Students will be able:

1. To write iterative programs.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction: | | |

|15 |Practice session-1: |2 | |

| |Ask students to write an algorithm to print their name N | | |

| |times. | | |

|15 |Sub topic-1(Lecture): |1 |Chalk & talk |

| |Explain the syntax of while statement and its execution | | |

| |flow Using Practice session-1. Discuss its Time | | |

| |Complexity. | | |

|20 |Practice session-2: |2 | |

| |Ask students to execute Practice session-1 problem. | | |

|40 |Practice session-3: |2 | |

| |Ask students to execute the following programs. | | |

| |How many three digit numbers are there that contains 1 and | | |

| |7 as it’s first or last digit.(with and without pointers). | | |

| |Sum of squares of first ten natural numbers is | | |

| |12+22+32+….+102 =385. Write a program to find the Sum of | | |

| |squares of first twenty natural numbers. | | |

|5 |Summary | | |

| |Home Work: | | |

| |To find a peculiar two digit number which is three times | | |

| |the sum of its digits. | | |

| |Write a program to print all possible pairs of prime | | |

| |numbers which are having distance 3 or less than 3 between| | |

| |them in a natural number line starting from 1 to given | | |

| |number N. | | |

| |Example: prime pairs with distance 3 | | |

| |Two students X and Y are playing a small game. Rules in | | |

| |game are: | | |

| |a). X and Y both have to throw an n-face die. Die contains | | |

| |n Positive natural numbers starting from 1 to n without | | |

| |duplicate number. | | |

| |b). If both Numbers, which are thrown by X and Y, are | | |

| |having no common factors except 1 then “game win by X” else| | |

| |“game win by Y”. | | |

| |Write a program to read n value and then find the | | |

| |probability to win X and also to win Y. | | |

| |Write a program to find whether the given number is | | |

| |palindrome or not. | | |

SESSION PLAN: 16

Session Outcome: At the end of this session on WHILE STATEMENT, Students will be able:

1. To write iterative programs.

|Time in Minutes |Topic |Blooms Taxonomy|Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction: | | |

| |Just make them to recall previous topic | | |

|30 |Practice session-1: |2 | |

| |Ask the student to write and execute A Program to check whether| | |

| |the given number is perfect number or not.(with and without | | |

| |pointers). | | |

|30 |Practice session-2: |2 | |

| |Ask the student to write algorithm for the following problem | | |

| |The following iterative sequence is defined for the set of | | |

| |positive integers: | | |

| |n → n/2(if n is even) | | |

| |n → 3n + 1 (if n is odd) | | |

| |Using the rule above and starting with 13, we generate the | | |

| |following sequence: | | |

| |13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 | | |

| |It can be seen that this sequence (starting at 13 and finishing| | |

| |at 1) contains 10 terms. Although it has not been proved yet | | |

| |(Collatz Problem), it is thought that all starting numbers | | |

| |finish at 1. | | |

|30 |Practice session-3: |2 | |

| |Ask the student to execute practice session -2 problem and also| | |

| |find its time complexity. | | |

|5 |Summary | | |

| |Home work: | | |

| |A survey of the computer market shows that personal computers | | |

| |are sold at varying cost by the vendors. The following is the| | |

| |list of costs(in thousands) quoted by some vendors: | | |

| |35.00 , 40.50 , 25.00, 31.25, 68.15, | | |

| |47.00, 26.65, 29.00, 53.45, 62.50. Write a program to | | |

| |determine the average cost and the range of values. | | |

SESSION PLAN: 17

Session Outcome: At the end of this session on FOR LOOP STATEMENT, Students will be able:

1. To write iterative programs.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction: | | |

| |Just make them to recall previous topic | | |

|15 |Practice session-1: |2 | |

| |Ask the student to write algorithm to print the series | | |

| |2,4,8,16,32…… | | |

|15 |Sub topic-1(Lecture): |1 |Chalk & talk |

| |Explanation on syntax of for statement and its execution | | |

| |flow. And also discuss its time complexity. | | |

|30 |Practice session-1: |2 | |

| |Student will execute the practice session -1 in their | | |

| |laptops. | | |

|30 |Practice session-2: | | |

| |Student will execute the following practicing program. | | |

| |Consider a goods train with 70 bogies. It starts from | | |

| |station X to station Y via 58 stations. In its travel, in | | |

| |every ith station where ‘i’ is prime, it drops out 2 bogies| | |

| |and proceeds. Find with how many bogies, it will reach | | |

| |station Y.(prime calculation). | | |

|5 |Summary | | |

| |Home Assignment: | | |

| |The angle of elevation of a ladder leaning against a wall | | |

| |is 600 and the foot of the ladder is 5m away from the wall.| | |

| |Write a c program to find the length of a ladder? | | |

| |Hint: ɭACB=60 and AC/BC= COS60. | | |

| |Ask students to write an algorithm & flow chart and | | |

| |program to produce the following output. | | |

| |A B C D E F G F E D C B A | | |

| |A B C D E F F E D C B A | | |

| |A B C D E E D C B A | | |

| |A B C D D C B A | | |

| |A B C C B | | |

| |A | | |

| |A B B| | |

| |A | | |

| |A | | |

| |A | | |

SESSION PLAN: 18

Session Outcome: At the end of this session on for STATEMENT, Students will be able:

1. To write iterative programs.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction: | | |

|25 |Practice session-1: |2 | |

| |Ask students to write program for the following: | | |

| |2520 is the smallest number that can be divided by each of | | |

| |the numbers from 1 to 10 without any remainder. What is the | | |

| |smallest positive number that is evenly divisible by all of | | |

| |the numbers from 1 to 20? | | |

|30 |Practice session-2: |2 | |

| |Ask students to execute the Practice session-1. | | |

|35 |Practice session-3: | | |

| |Ask the student execute the practice problem: | | |

| |Assume four different banks would like to sanction | | |

| |10,000/-,12,000/-,14,000/-,16,000/- loan amounts @ | | |

| |9%,10.25%,11.50% interest. Display the interest amounts for | | |

| |the above specified values. | | |

|5 |Summary | | |

| |Home work: | | |

| |Ask students to write an algorithm, flow chart and program to| | |

| |generate all permutation of 1, 2 and 3. | | |

SESSION PLAN: 19

Session Outcome: At the end of this session on do-while iteration, Students will be able:

1. To write iterative programs using do-while.

2. Able to distinguish between while & do-while.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction. | | |

|25 |Practice session -1: |2 | |

| |Each new term in the Fibonacci sequence is generated by | | |

| |adding the previous two terms. By starting with 1 and 2, the | | |

| |first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, | | |

| |... By considering the terms in the Fibonacci sequence up to | | |

| |whose values do not exceed four million, find the sum of the | | |

| |even-valued terms. write program to generate Fibonacci | | |

| |sequence. | | |

|10 |Sub topic-1(Lecture): |1 |Chalk & talk |

| |Use problem1 & explain the syntax of Do-while statement and| | |

| |its execution flow. | | |

|25 |Practice session-1: |2 | |

| |Ask students to execute the program-1 . | | |

|30 |Practice session-2: | | |

| |Ask Students to write the following program. | | |

| |A number X is said to be ‘seed’ of number Y if multiplying X | | |

| |by its digit equates to Y. For example, 123 is a seed of 738 | | |

| |coz 123*1*2*3 = 738. Now given a number find all its ‘seed’ | | |

| |numbers. | | |

|5 |Summary | | |

| |Home Assignment: | | |

| |Write a program to find sum of individual digits of a given | | |

| |positive integer. | | |

| |Write a program to find number of odd days for a given first | | |

| |N years using while statement. | | |

| |Write a program to print the following number sequence N | | |

| |number of times. | | |

| |1.00, 0.09, 0.08, 0.07, ------- 0.00, -0.01, -0.02, -0.03, | | |

| |------ -1.00, -0.09,0.08, 0.07, 0.06 --- 1.00 | | |

| |4. start by inputting two numbers(eg. 4 and 9) and display| | |

| |their math tables up to 10 by skipping the display if | | |

| |multiplier and multiplicand are the same. | | |

| |5X1=5 6X1=6 . . 9X1=9 | | |

| |. . . . . . | | |

| |. . . . . . | | |

| |5X4=20 6X5=30. . . . | | |

| |5X6=30 6X7=42. . . . | | |

| |. . . . . . | | |

| |. . . . . . | | |

| |9X8=72 | | |

| |5X10=50 6X10=60. .9X10=90 | | |

| |Note : better to practice with for, while and do..while | | |

| |constructs. | | |

SESSION PLAN: 20

Session Outcome: At the end of this session on ANALYSIS OF ALGORITHMS Students will be able:

1. Understand time complexity

2. Calculate time complexity for simple problems

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction | | |

| |Recap previous class topic | | |

|30 |Sub-topic-1 (Lecture): |1 | |

| |Explanation of Asymptotic notations(Big Oh, Omega, Theta) | | |

|30 |Practice Session-1: |2 |Chalk & talk |

| |Find time complexity for the following | | |

| |To print sum of first N natural numbers. | | |

|30 |Practice Session-2: |2 | |

| |In a factory weekly wages of workers will be calculated as follows:- | | |

| |First 35hrs are considered as regular hours. | | |

| |Hours exceeding 35hrs are considered as overtime. | | |

| |Develop an algorithm to   input worker’s name, hours worked and rate per | | |

| |hour, and then print name and total wages. Overtime wages is paid @ 2 times| | |

| |the rate. And also estimate its time complexity. | | |

|5 |Conclusion | | |

| | | | |

SESSION PLAN: 21

Session Outcome: At the end of this session on Functions –Basic concepts, Types, Categories of functions students will be able to:

1. Know the benefits of function in computer programming.

2. Apply structured programming concepts in solving problems.

3. Solve computer applications with modular concepts.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction. | | |

|15 |Practice session-1: a and b are two integers. calculate value|2 | |

| |of (a+b)2. Write algorithm. | | |

|30 |Sub task-1(Lecture): What is a function, necessity of |1,2 |Chalk & talk |

| |function, function declaration, definition, function | | |

| |prototype in C. We will ask students to practice the Practice| | |

| |session-1 problem .(using pointers). | | |

|20 |Practice session-2: |1 | |

| |Write a function that takes one character as input and prints| | |

| |out that character plus the next 5 characters , separated by | | |

| |tabs. The function takes one char argument, and returns a | | |

| |char. | | |

| |For example, if the value of the argument passed to the | | |

| |function was ‘m’, then the function would print : | | |

| |m n o p q r | | |

| |and return ‘r’. show separately the function declaration , | | |

| |the function definition and function invocation. | | |

|25 |Sub task-2(Lecture): Categories of functions-without argument|1 |Chalk & talk |

| |without return type, With argument without return type, | | |

| |Functions without argument with return type, with argument | | |

| |and with return. Students are asked to do simple problems for| | |

| |the above tasks understanding. | | |

|05 |Conclusion & Summary | | |

| |Home Assignment: | | |

| |Write a c program to find the given number is Armstrong | | |

| |number or not, using user defined function. | | |

| |Raising a number n to a power p is same as multiplying n by | | |

| |itself p times. Write a function called power that takes 2 | | |

| |arguments, a double value for n and an int value for p and | | |

| |returns the result as double value. Write main function that | | |

| |gets value from the user to test power function. | | |

SESSION PLAN: 22

Session Outcome: At the end of this session on Functions –function pointer, call by value & call by reference students will be able to

1. Know the benefits of function in computer programming.

2. Apply structured programming concepts in solving problems.

3. Write functions using call- by – value & call- by- reference.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction. | | |

|10 |Sub task-1(Lecture): | | |

| |Explain function pointer & pointer to a function. | | |

|30 |Practice session-1: | | |

| |Given two numbers a and b, find kth digit from right of a^b. | | |

| |(Flipkart). Ask students to write a C program(using | | |

| |pointers). | | |

|15 |Sub task-2(Lecture): | | |

| |Explain call by value & call-by – reference. | | |

|35 |Practice session-2: |1 |Chalk & talk |

| |Given a number x find the square root of it. If x is not a | | |

| |perfect square, then print the floor value of square root of | | |

| |x. (Amazon, Microsoft, Accolite) Ask students to write a C | | |

| |program (using pointers). | | |

|05 |Conclusion & Summary | | |

| |Home assignment: | | |

| |What is the output for the following: | | |

| |#define CUBE(x) (x * x * x) | | |

| |main( ) | | |

| |{ | | |

| |printf(“%d”, CUBE(4+5)); | | |

| |} 4+5*4+5*4+5=4+20+20+5=49 | | |

SESSION PLAN : 23

Session Outcome: At the end of this session on Recursive Function – Introduction, Examples students will be able to:

1. Think in logical way to solve real-time applications using functions.

2. Solve computer applications with recursive concept.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction. | | |

|20 |Practice session-1: given F(0) =1 and F(1) = 1. Then write a |1,2 | |

| |function to find F(n). | | |

| |Where F(n) = n * F(n-1). Ask students to print the factorial| | |

| |of a given number? | | |

|30 |Explain what is recursion & how recursive functions work? |1 |Chalk & talk, visualization |

|20 |Practice session-2: given F(0) =1 and F(1) = 1. Then write a |2 | |

| |function to find F(n). | | |

| |Where F(n) = F(n-1) + F(n-2). Ask students to generate a | | |

| |Fibonacci series. | | |

|20 |Ask the students to execute Practice session-1. |2 | |

|05 |Conclusion & Summary | | |

| |Home Assignment: | | |

| |1) Write a program to perform GCD of two numbers and | | |

| |exponents of “y” using recursive function. | | |

SESSION PLAN : 24

Session Outcome: At the end of this session on Recursive Function – Introduction, Examples students will be able to:

1. Think in logical way to solve real-time applications using functions.

2. Solve computer applications with recursive concept.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction. | | |

|30 |Practice Session -1: |2 | |

| |Write a program to convert the given decimal number into | | |

| |equivalent binary number using recursion. | | |

|20 |Ask student to execute Practice Session -1 problem. | | |

|40 |Practice Session -2: |2 | |

| |Write a recursive function that displays a positive integer | | |

| |in words. Ex: if the integer is 465 then it is displayed as: | | |

| |FOUR SIX FIVE. | | |

|05 |Conclusion & Summary | | |

| |Home Assignment: | | |

| |Implement the towers of HANOI problem using the above | | |

| |concept. | | |

| |. | | |

SESSION PLAN: 25

Session Outcome: At the end of this session on Storage Classes – Introduction, Types, Examples students will be able to:

1. Solve computer applications using structured programming.

2. Think in logical way to solve real-time applications using storage classes.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction. | | |

|15 |Practice session-1: IDENTIFY output of the following: | | |

| |Void stat(void); | | |

| |main() | | |

| |{ | | |

| |int i; | | |

| |for(i=1;i≤3;i++) | | |

| |stat(); | | |

| |} | | |

| |void stat() | | |

| |{ | | |

| |static int x= 10; | | |

| |x=x+1; | | |

| |printf (“%d”,x); | | |

| |} | | |

|30 |Sub topic-1(Lecture): Explanation of different types of |1 |Chalk and talk |

| |storage classes (auto, register, static, extern) with | | |

| |programs. | | |

| |1. Program to perform addition of two numbers using auto | | |

| |keyword | | |

| |2. Program to perform addition of two numbers using registers| | |

| |keyword | | |

|20 |Practice session-2: We will ask students to write programs |2 | |

| |1. To print the series of integer numbers up to ‘n’ using | | |

| |static keyword. | | |

| |2. Program to read and display the values using extern | | |

| |keyword. | | |

| |3. What is the output of the following programs: void main() | | |

| |{ | | |

| |static int a=6; | | |

| |printf(“\na=%d”,a--); | | |

| |if(a!=0) | | |

| |main(); | | |

| |} | | |

|10 |Sub topic-2(Lecture): Explanation of Local and global |1 |Chalk and talk |

| |variables, #define and some of the macros with examples | | |

|05 |Conclusion & Summary | | |

| |Home Assignment: | | |

| |What is the output of the following: | | |

| |(a). void main() | | |

| |{ | | |

| |fun1(); | | |

| |fun1(); | | |

| |} | | |

| |void fun1() | | |

| |{ | | |

| |auto int x=0; | | |

| |register int y=0; | | |

| |static int z=0; | | |

| |x++; | | |

| |y++; | | |

| |z++; | | |

| |printf(“\n%d%d%d”,x,y,z); | | |

| |} | | |

| |(b) | | |

| |int a=10; | | |

| |void main() | | |

| |{ | | |

| |int a=20; | | |

| |{ | | |

| |int a=30; printf(“%d\n”,a); | | |

| |} | | |

| |printf(“%d”,a); | | |

| |} | | |

| |. | | |

SESSION PLAN : 26

Session Outcome: At the end of this session on Arrays – 1 Dimensional students will be able to

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction. | | |

|15 |Practice session-1: | | |

| |Consider a closed circuit containing ten resistors | | |

| |connected in series with resistances | | |

| |10,12,13,22,34,44,45,5,55,7 respectively. Find the total | | |

| |resistance of the circuit. | | |

|20 |Sub task-1(Lecture): | |Chalk & talk, visualization |

| |Explain one-dimensional arrays . | | |

|30 |Practice session-2: | | |

| |Ask students to Write a C program for Practice session-1 | | |

| |problem. | | |

|25 |Practice session-3: | | |

| |Write a program to process a collection of daily high | | |

| |temperatures. Your program should count and print the number | | |

| |of hot days (high temperature 85 or higher), the number of | | |

| |pleasant days (high temperature 60–84), and the number of | | |

| |cold days (high temperatures less than 60). It should also | | |

| |display the category of each temperature. Test your program | | |

| |on the following data: | | |

| |55 62 68 74 59 45 41 58 60 67 65 78 82 88 91 92 90 93 87 80 | | |

| |78 79 72 68 61 59 | | |

|05 |Conclusion & Summary. | | |

| |Home Assignment: | | |

SESSION PLAN : 27

Session Outcome: At the end of this session on Arrays – pointer to an array & array of pointers students will be able to

1. Write programs that uses list data and refer the data by means of addresses.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|5 |Recap / Introduction. | | |

|20 |Sub task-1(Lecture): |1 | |

| |Explain array of pointers & pointer to an array. | | |

|30 |Practice session-1: |2 |Chalk & talk, visualization |

| |Ask students to Write a C program for the following using | | |

| |pointers: | | |

| |Given an integer array, for each element in the array check | | |

| |whether there exist a smaller element on the next immediate | | |

| |position of the array. If it exist print the smaller | | |

| |element. If there is no smaller element on the immediate next| | |

| |to the element then print -1. | | |

| |Example Input: 4 2 1 5 3 Output: 2 1 -1 3 -1 (Amazon). | | |

|20 |Practice session-2: |2 | |

| |Ask students to write a program (using pointers) that | | |

| |calculates the average of n numbers & then compute the | | |

| |deviation of each number about the range. | | |

|20 |Practice session-3: | | |

| |What will be the output for the following problems: | | |

| |void main() | | |

| |{ | | |

| |int a[]={1,2,5,6,9,10}; | | |

| |int *b=&a[4]; | | |

| |printf(“%d\n”, b[-3]); | | |

| |} | | |

| |void main() | | |

| |{ | | |

| |int a[]={1,2,9,8,6,3,5,7,8,9} | | |

| |int *p=a+1; | | |

| |int *q=a+6; | | |

| |printf(“%d\n”, q-p); | | |

| |} | | |

|05 |Conclusion & Summary | | |

| |Home Assignment:. | | |

SESSION PLAN : 28

Session Outcome: At the end of this session on 2 Dimensional arrays students will be able to:

1. Write programs with 2D arrays

2. Implement programs with huge data and Passing arrays to functions.

|Time in Minutes|Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|05 |Recap / Introduction. | | |

|10 |Practice session -1: |2 | |

| |A and B are two mxn matrices. Find the third matrix C= A+B. | | |

| |write algorithm for matrix addition. | | |

|15 |Practice session -2: |2 | |

| |Ask the student to write program for problem1. | | |

|10 |Explanation of 2D Array and its syntax. |1 |Chalk & talk |

|10 |Practice session -3: | | |

| |In a small company there are 5 salesmen. Each sales man is | | |

| |supposed to sell three products. Draw flow chart & algorithm | | |

| |to print | | |

| |The total sales by each salesman. | | |

| |Total sales of each item. | | |

|45 |Practice session -4: |2 | |

| |Ask the students to write & execute a c program for Practice | | |

| |session -3 problem | | |

|05 |Conclusion and summary. |2 | |

| |Home Assignment: | | |

| |Given 2 matrices A, B of order m x n. The basic operations on | | |

| |matrices are Addition, Subtraction, transpose and | | |

| |multiplication. Write C programs for the following: | | |

| |Matrix Multiplication | | |

| |Transpose of matrix. | | |

| |Magic square problem. (sum of row, Column and diagonals = 15) | | |

| |Write a program to calculate grades of 4 students from 3 test | | |

| |scores. | | |

| |Let A(nxn) that are not diagonal array. Write a program to find| | |

| |the sum of all the elements which lie on either diagonal. For | | |

| |example for the matrix shown below, your program should output | | |

| |68=(1+6+11+16+4+7+10+13): | | |

| |1 2 3 4 | | |

| |5 6 7 8 | | |

| |9 10 11 12 | | |

| |13 14 15 16 | | |

SESSION PLAN : 29

Session Outcome: At the end of this session on : Searching – Linear search students will be able to:

1. Understand, how to search an element using linear search?

2. Think, how to search an element with less time using an array?

|Time in |Topic |BTL |Teaching – |

|Minutes | | |Learning Method |

|05 |Recap / Introduction: | | |

|10 |Practice session -1: |2 | |

| |There are 10 water bottles in a tray, out of 10 bottles; one bottle is getting leaked from the | | |

| |bottom. Now you have to find out which bottle is getting leaked. Provide the solution for the | | |

| |problem statement. | | |

| | | | |

| | | | |

|15 |Practice session -2: |2 | |

| |Ask students to Write algorithm for Practice session -1. | | |

| | | | |

| | | | |

|15 |Explain about linear search & its drawbacks. |1 |Chalk & talk |

|30 |Practice session -3: |2 | |

| |Ask student to write program for linear search & execute | | |

|20 |Practice session 4: |2 | |

| |Ask students to modify the above program to print the location of leaky bottle in Practice | | |

| |session -1problem. | | |

|5 |Conclusion and summary. |2 | |

| | | | |

|Home Assignment: |

|Ask students to write a program to find the average of given N positive integers and then find out the number of elements exist less than |

|the average and greater than the average. Ask students to execute the program. |

|In a school, A statistics of weights average of the students are given. 35Kg,42Kg,72Kg,63Kg,25Kg,55Kg. Logically provide a solution for |

|finding the smallest and biggest among the given average weights. |

|A non-empty zero-indexed array A consisting of N integers is given. the consecutive elements of array A represent consecutive cars on a |

|road. |

|Array A contains only 0s and/or 1s: 0 represents a car traveling east, 1 represents a car traveling west. The goal is to count passing cars.|

|We say that a pair of cars (P, Q), where 0 ≤ P < Q < N, is passing when P is traveling to the east and Q is traveling to the west. |

Session PLAN : 30

Session Outcome: At the end of this session on : Searching –Binary search students will be able to:

1. search an element using Binary search?

2. search an element with less time using an array?

3. Solve problems using divide and conquer strategy.

|Time in |Topic |BTL |Teaching – |

|Minutes | | |Learning Method |

|05 |Recap / Introduction. | | |

|15 |Practice session -1: |2 | |

| |In a text book of 520 pages, you need to find a diagram whether it is on 470th page. What is the| | |

| |simplification for the above search? Give a solution for the problem statement. | | |

| |Note: | | |

| |1) You are not supposed to compare each and every page. | | |

| |2) Every time find out the middle page((low+high)/2) and compare only with that page. | | |

| |3.1) If it is found print as found and Stop. | | |

| |3.2) Otherwise | | |

| |3.2.1) if the page to be found is less than middle page then | | |

| |Set high=mid-1 & Repeat steps 2 to 3. | | |

| |3.2.2) if the page to be found is greater than middle page set low=mid+1 Repeat | | |

| |steps 2 to 3. Until it is found. | | |

| | | | |

| | | | |

| | | | |

| | | | |

| | | | |

|15 |Practice session -2: |2 | |

| |Ask students to Write pseudo code/ algorithm for Practice session -1. | | |

|15 |Explain binary search. |1 |Chalk & talk |

|25 |A Practice session -3: |2 | |

| |Ask students to execute the program for binary search problem. | | |

|20 |Analyze the performance of binary search. | | |

|5 |Conclusion and summary. |2 | |

| |Home Assignment: | | |

| |There are 10 students sitting in a row, in which the professor wants to select a student with | | |

| |roll no 420 from one end to other end. Give me a solution for the given problem statement. (The | | |

| |roll nos are 400,320,480,390,200,850,460,420,600). | | |

SESSION PLAN : 31

Session Outcome: At the end of this session on Sorting - Bubble sort with examples students will be able to:

1. Sort non-numeric data using bubble sort.

2. Solve computer applications with modular concepts for sorting.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|05 |Recap / Introduction | | |

|10 |Practice session -1: |2 | |

| |Design an algorithm to accept the age of 20 students of a | | |

| |class. Rearrange the data in ascending order(smallest value | | |

| |to largest value). Display the age of the youngest and eldest| | |

| |student in the class. | | |

|20 |Practice session -2: |2 | |

| |Ask students to write an algorithm and C function for above | | |

| |Practice session -1 problem. | | |

|20 |Explain about bubble sort. |1 |Chalk & talk and visualization |

|40 |Practice session -3: |2 | |

| |Ask the students to execute the bubble sort. | | |

|5 |Conclusion and Summary | | |

| |Home Assignment: | | |

| |There are 10 cool drink bottles of different capacity. They | | |

| |are 200ML, 100ML, 180ML, 300ML, 500ML, 90ML, 360ML, 270ML, | | |

| |1000ML, 750ML. Arrange the bottles in Ascending order / | | |

| |Descending order of their capacity. | | |

| |An array contains the elements shown below. The first two | | |

| |elements have been sorted using a bubble sort. What would be | | |

| |the value of the elements in the array after four more passes| | |

| |of the bubble sort algorithm? | | |

| |7, 8, 26, 44, 13, 23, 57, 98 | | |

| |In a statistics among 15 students of their weight (e.g. 62Kg,| | |

| |57Kg, …) in physical department at an University is | | |

| |collected. Write a program for sorting the weights in | | |

| |descending order and print the second biggest weight. | | |

| |Write a program to sort an array of following elements and | | |

| |print the count of the same elements in the order. | | |

| |The given elements are | | |

| |Input: 2,5,4,1,3,5,2,5,1 | | |

| |Output: | | |

| |1 is repeated for 2 Times | | |

| |2 is repeated for 2 Times | | |

| |3 is repeated for 1 Time | | |

| |4 is repeated for 1 Time | | |

| |5 is repeated for 3 Times | | |

SESSION PLAN : 32

Session Outcome: At the end of this session on operations on Strings students will be able to:

1. Write programs using non-numeric data.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level-1 | |

|05 |Recap / Introduction: Recalling previous topic. | | |

| 10 |Practice session -1: |1 | |

| |In cryptography, a Caesar cipher, also known as Caesar's | | |

| |cipher, is one of the simplest and most widely known | | |

| |encryption techniques. It is a type of substitution cipher in| | |

| |which each letter in the plaintext is replaced by a letter | | |

| |some fixed number of positions above the alphabet. For | | |

| |example, with a right shift of 3, D would be replaced by G, E| | |

| |would become H, and so on. The method is named after Julius | | |

| |Caesar, who used it in his private correspondence .Ask the | | |

| |students to write an algorithm for the problem statement. | | |

| |Ex: input: Hai | | |

| |Output: Kdl | | |

|15 |Sub Topic (lecture): |1 | |

| |explain string manipulation | |Chalk & talk |

|25 |Ask students to write program for problem- 1 | | |

|15 |Practice session - 2: Students will write a Program to count |2 | |

| |number of vowels, consonants, words, digits and symbols in a | | |

| |line of text. | | |

|15 |Sub topic(lecture): Explanation about string functions with |1 | |

| |the program to calculate length, string reverse, strcpy, | | |

| |strcat, strcmpi(), strcmp() of the given string. | | |

|15 |Practice session - 3: Students will practice the execution of|2 | |

| |the program to calculate length of the string by using the | | |

| |string function strlen(), strrev(), strcpy(), strncpy(), | | |

| |strcat(), strcmpi(), strcmp() | | |

|05 |Conclusion and summary. | | |

| |Home Assignment: | | |

| |Develop a program to find RED color pebble form the given | | |

| |pebbles of different colors. | | |

| |For the given paragraph, write a program to count how many | | |

| |times the string “the” present in it. [Vijayawada is a | | |

| |beautiful city on the bank of the Krishna River, in the | | |

| |Indian state of Andhra Pradesh ] | | |

| |Write a program to reverse a string. | | |

| |Every rainbow has seven colors beginning with red and ending | | |

| |with violet or purple. To remember the order of these colors,| | |

| |people use the acronym VIBGYOR which stands for Red Orange | | |

| |Yellow Green Blue Indigo and Violet. Your task is to sort the| | |

| |colours of rainbow “VIBGYOR” in alphabetical order. | | |

| |[ Output: 1) Blue, 2) Green 3) Indigo, 4) Orange, 5) Red, 6) | | |

| |Violet and 7) Yellow. ]. | | |

SESSION PLAN : 33

Session Outcome: At the end of this session on operations on strings and pointer to a string students will be able to:

At the end of this session, Students will be able to:

1. Write programs on non-numeric data.

2. Solve real world practical problems.

|Time in Minutes |Topic |Blooms Taxonomy |Teaching Methodology |

| | |Level | |

|05 |Recap/Introduction | | |

|10 |Sub topic(lecture): |1 | |

| |Explain pointer to a string using the following: | |Chalk & talk |

| |void strcpy1(char *dst, char *src); | | |

| |void main() | | |

| |{ | | |

| |char *src = “Hello World”; | | |

| |char dst[100]; | | |

| |strcpy1(src,dst); | | |

| |printf(“%s”,dst); | | |

| |} | | |

| |void strcpy1(char *dst, char *src) | | |

| |{ | | |

| |while(*src){ | | |

| |*dst++=*src++;} | | |

| |*dst=’\0’; | | |

| |} | | |

|20 |Practice session -1: |2 | |

| |Write a c program for the following: | | |

| |Given two strings s1 & s2, remove those characters from first| | |

| |string which are present in second string. Both the strings | | |

| |are different and contain only lowercase characters. (Amazon)| | |

|15 |Ask students to write algorithm for Practice session -1. | | |

|20 |Ask students to write program for Practice session -1. | | |

|10 |Practice session -2: |1 | |

| |To perform pattern matching. Example: ”Harish saw me in | | |

| |cinema hall” - pattern to search is “hall”. Ask students to | | |

| |write algorithm. | | |

|15 |Ask students to write program for Practice session -2. |2 | |

|05 |Conclusion and Summary. | | |

| |Home Assignment: | | |

| |Write a program to read all lines of text from the keyboard | | |

| |and display the following information | | |

| |Number of words | | |

| |Number of characters. | | |

| |Design a function locate() that takes 2 character arrays s1 | | |

| |and s2 and one integer value m as parameters and insert the | | |

| |string s2 into s1 immediately after the index m. | | |

| |Ex: S1= I enjoy eating while watching Sharukh Khan movie. | | |

| |M=15 | | |

| |S2= Popcorn | | |

| |Hint: s2 may be a missing word in s1 that represents a line | | |

| |of text | | |

SESSION PLAN : 34

Session Outcome: At the end of this class on Introduction to structures students will be able to:

1. Implement user defined data type structure

2. Apply the concepts of structure variables to store records.

|Time(min) |Topic |BTL |Teaching – Learning Method |

|5 |Recap | | |

|10 |Practice session -1: | | |

| |Study the information displayed on your ID card and analyze their types of | | |

| |data values. Now discuss how to store the above information into a record | | |

| |format. | | |

|10 |Practice session -2: |2 | |

| |Analyze and evaluate about the storage details of account holders of | | |

| |specified Bank branch, Vijayawada. | | |

|20 |Sub-topic Lecture: |1 |Chalk and talk |

| |Explanation about user defined data type structure. | | |

|15 |Ask students to write C program for problem1 | | |

|20 |Ask student to execute the problem2. | | |

|15 |Practice session -3: |2 | |

| |Student asked to execute the following program. | | |

| |The XYZ company manufactures various auto mobile spare parts suitable for 2,3| | |

| |and wheelers. To do this the company stores details of the products as sno, | | |

| |description, pcode and price. The product code is represented as alpha | | |

| |numeric code of four in length .The first two characters represents 2W,3W and| | |

| |4W followed by a number to represent year of manufacture .Now write a program| | |

| |the details of the product manufacture for three wheelers during 2015. | | |

|05 |Conclusion and summary | | |

| |Home Assignment: | | |

| |Define a structure CRICKET whose fields are name of the player, number of | | |

| |innings played, total runs scored and getting average. Using CRICKET declare | | |

| |an array x with 50 elements and write a program to read the name, number of | | |

| |innings and total runs scored by each of the 50 players, and find the | | |

| |batting average. Display all the 50 players details sorted by batting average| | |

| |in tabular from. | | |

| |Define a structure DATE with the fields: day, month and year. Write a program| | |

| |that will increment the date by one day and return the new date. If the date | | |

| |is the last day in the month, the month field must be incremented by one. If | | |

| |the month is December, the value of the year field must be changed when the | | |

| |day is 31. Also check for the leap year. | | |

| |Define a structure COMPLEX whose fields are real and imaginary parts of a | | |

| |complex number. Write a program to find sum of two complex numbers. | | |

SESSION PLAN : 35

Session Outcome: At the end of this class on Pointer to structures & unions students will be able to:

1. Implement user defined data type structure

2. Apply the concepts of structure variables to store records.

|Time in Minutes |Topic |BTL |Teaching Methodology |

|10 |Explain DMA | | |

| |(maaloc, calloc and free) | | |

|10 |Sub topic-1(lecture): | | |

| |Explain structure pointer. | | |

|30 |Practice session -1: | | |

| |Declare a type-defined structure for an inventory item consisting of 6 fields: part | | |

| |number, part description (DMA string),reorder point(integer),number of items currently | | |

| |on hand(integer),unit measure, unit price. Display the student details using pointers. | | |

|20 |Practice session -2: | | |

| |Define a structure with the following address fields: street, block, area, country. | | |

| |Write a program to conduct search for an address based on any of these fields.(using | | |

| |structure pointers). | | |

|15 |Sub topic-2(lecture): | | |

| |Explain the concept of unions and difference between structure and unions | | |

|10 |Practice session -3: | | |

| |Find the output of the following: | | |

| |union student | | |

| |{ | | |

| |int  mark; | | |

| |char name[10]; | | |

| |float average; | | |

| |}s; | | |

| |struct student | | |

| |{ | | |

| |int  mark; | | |

| |char name[10]; | | |

| |float average; | | |

| |}s1; | | |

| | | | |

| |int main() | | |

| |{ | | |

| | | | |

| |printf("%d\n", sizeof(s)); | | |

| |printf(“%d”,sizeof(s1)); | | |

| |} | | |

|5 |Summary. | | |

SESSION PLAN : 36

Session Outcome: At the end of this class hour on Implementation of stacks using arrays my students will be able to:

1. Implement a LIFO Data Structure STACK.

|Time(min) |Topic |BTL |Teaching – Learning Method |

|10 |Recap typedef and structures | | |

|10 |Practice session -1: |2 | |

| |Assume you are given a CD spindle, to store 20 movie CD’s. Write an algorithm| | |

| |to pick out 14th CD from the spindle. | | |

| |Points to consider: | | |

| |At a time only one CD can be inserted or deleted from the spindle from its | | |

| |top end. | | |

| |Should not store more than 20 CD’s | | |

| |No CD can be removed from an empty spindle | | |

|20 |Ask students to write algorithm for the Practice session -1. | | |

|20 |Ask students to write C functions for Practice session -1. | | |

|20 |Sub- topic-1 (Lecture): | | |

| |Explanation about stack DS | | |

|15 |Practice session -2: |2 | |

| |Ask students to solve the following problems: | | |

| |A Stack s stores int values. Show what s will look like after each of the | | |

| |following instructions is executed. | | |

| | | | |

| |s.push(5); | | |

| |s.push(1); | | |

| |s.push(4); | | |

| |s.push(3); | | |

| |s.pop( ); | | |

| |s.push(2); | | |

| |s.pop( ); | | |

| |s.pop( ); | | |

| |s.push(8); | | |

| |s.push(7); | | |

| |s.pop( ); | | |

| |s.push(3); | | |

| |2. What is the output of the following code? | | |

| |int values[10]= {1, 3, 5, 7, 9, 11, 13, 15, 17, 19 }; | | |

| |int n=0; | | |

| |for ( i = 0; i ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download