FLIPPED CLASSROOM ACTIVITY CONSTRUCTOR FA RECURSIVE FUNCTIONS IN



















- Slides: 19

FLIPPED CLASSROOM ACTIVITY CONSTRUCTOR (FA)– RECURSIVE FUNCTIONS IN C IDP in Educational Technology, IIT Bombay

About this constructor ->This FA helps to learn about function declaration, function definition and function calling for recursive function in C programming language. ->This flipped activity constructor has Open Educational Resource(OER) licensed under Creative commons. IDP in Educational Technology, IIT Bombay 2

Table of Contents SECTION SLIDE # ABOUT CONSTRUCTOR 2 ABOUT ME 4 OUT-OF-CLASS SEGMENT 5 -8 IN-CLASS SEGMENT 9 -18 JUSTIFICATION 19 IDP in Educational Technology, IIT Bombay 3

Raja Ratna S TOPIC: Recursive Function in C COURSE: Basic Programming in C DOMAIN: Computer Science & Engineering TARGET AUDIENCE: I Year UG students in Computer Science AFFILIATION (UNIVERSITY/COLLEGE): Anna University/VV College of Engineering IDP in Educational Technology, IIT Bombay 4

Out-of-class Activity Design -1 Learning Objectives of Out-of-Class Activity After watching the videos the student will be able to 1. To understand how the function calls itself recursively. 2. Write a C program using recursive functions (Apply) Key Concepts to be covered 1. A function calling itself. 2. Difference between returning the value to the main function and printing the value in the function itself. IDP in Educational Technology, IIT Bombay 5

Out-of-class Activity Design - 2 https: //www. youtube. com/watch? v=a. Hw. Tb. R-d. Zio Video Sources- URL Creative Commons Attribution license (reuse allowed) License of Video Mapping Concept to Video Source CONCEPT VIDEO SEGMENT DURATION (in min) V 1 - 0: 00 – 8: 34 8. 34 RECURSIVE FUNCTION IN C TOTAL DURATION 8. 34 min IDP in Educational Technology, IIT Bombay 6

Out-of-class Activity Design - 3 Aligning Assessment with Learning Objective 1. To understand how the function calls itself recursively. Assessment Strategy Expected Duration (in min) Q. Find out the line in C which calculates the factorial of a integer variable factorial. The function name is fact. 1)return factorial*fact(factorial-1) 5 minutes 2)factorial*fact(factorial-1) 3)return factorial*(factorial -1) 4) factorial*(factorial-1) IDP in Educational Technology, IIT Bombay Additional Instructions (if any) 1)Carefully watch the video and answer the question. 2) 5 marks in internal will be added if assessment submission done before coming to class. 7

Out-of-class Activity Design - 3 Aligning Assessment with Learning Objective Write a C program using recursive function Assessment Strategy Write a C program explaining two recursive functions in a single program, one with argument and another without argument. Expected Duration (in min) 10 minutes Total Activity 15 minutes Duration IDP in Educational Technology, IIT Bombay Additional Instructions (if any) 1. Use different names for two functions. 2. Assessment will be considered as lecture hour and attendance will be given for those who submit it before coming to next class. 8

In-class Activity Design -1 Learning Objectives of In - Class Activity After the in-class activities students will be able 1. Identify the usage of recursive function. (Analyze) 2. Able to write programs in C using recursive function for a specific application in real world. (Implement) Key Concepts to be covered 1. Recursive function with argument and without argument. 2. How to use recursive function in C for efficient programming solving real-time problems. IDP in Educational Technology, IIT Bombay 9

In-class Activity Design -2 Active Learning activities that I planned to do 1. Peer instruction(PI) 2. Think-pair-Share(TPS) IDP in Educational Technology, IIT Bombay 10

In-class Activity Design -2 Active Learning activities that I planned to do Real world problem solving using. § Think-Pair-Share Concept clarification using. § Peer Instruction IDP in Educational Technology, IIT Bombay 11

In-class Activity Design -2 Peer Instruction Strategy – What Teacher Does At the beginning of the class the teacher posts 2 PI questions related to recursive function and explain in detail a clear picture of this concept. Q 1: #include <stdio. h> int fact(int n); void main() { int n=5; f=fact(n); printf("%d", “f=”, f); } int fact(int n) { if(n>1) return n*fact(n-1); else return n; } Pick out the which is correct for function declaration: a) void fact(int n); b) int fact(int n); c) int fact(n); d) int fact(); IDP in Educational Technology, IIT Bombay 12

In-class Activity Design -2 Peer Instruction Strategy – What Teacher Does Q 2: : #include <stdio. h> void fact(); void main() { fact(); } void fact() { int n=5, f=1; if(n>1) f= f*fact(n-1); printf("%d", f); else printf("%d", n); } Pick out the which is correct for factorial calculation: a) ) f= f*fact(n-1); b) n*fact(n-1)); c)return n*fact(n-1); d) return f*fact(n-1); IDP in Educational Technology, IIT Bombay 13

In-class Activity Design -2 Peer Instruction Strategy – What Student Does § For each PI question students think individually and vote using clickers. § After voting students have discussion with their peers and come to a conclusion. § After discussion the students listen to the teachers explanation. IDP in Educational Technology, IIT Bombay 14

In-class Activity Design -2 TPS Strategy – What Instructor does Design a Server-Client Bank periodic refresh program in C. Use the recursive function concept to refresh the data between the bank server and clients. Recursion is nothing but to repeatedly call the function itself. IDP in Educational Technology, IIT Bombay 15

In-class Activity Design -2 TPS Strategy – What Instructor does Think (~2 minutes) Instructions: 1. In the bank sever- client periodic refresh program assume that the client is at some remote locations. 2. Movement in both direction from client to server and server to client is allowed. Individually think how can you design Bank sever- client periodic refresh program using C with recursive function concept for to and fro movement between the clients and the server. IDP in Educational Technology, IIT Bombay 16

In-class Activity Design -2 TPS Strategy – What Instructor does Pair (~5 minutes) Instructions: 1. The students are asked to form pairs and have a discussion among themselves to find whose program is efficient way to implement the concept. 2. The instructor goes around the class and check out 2 - 3 pairs discussion to see what they are doing. IDP in Educational Technology, IIT Bombay 17

In-class Activity Design -2 TPS Strategy – What Instructor does Share (~8 minutes) 1. The instructor ask the pairs to share their C program (Bank sever- client periodic refresh application with recursive function concept )with other students in the class. 2. Check out whethere are different C code for Bank sever- client periodic refresh application. 3. The instructor gives out optimal C code with recursive function for designing Bank sever- client periodic refresh application. In the next iteration in TPS, in think phase the students can be asked to think about the movement of data between the client and the server in bank application. In pair phase compare the code. In share phase select the optimal code. IDP in Educational Technology, IIT Bombay 18

In-class Activity Design -2 Justification why the above is an active learning strategy 1. In both the above strategies, students go beyond mere listening and execution of prescribed steps. 2. Students are asked to think deeply about the content they were familiarized in out-ofclass and do higher order thinking. 3. There is also feedback provided (either through peer discussion or instructor summary) IDP in Educational Technology, IIT Bombay 19