 We will now have brief presentations on each of the uploaded final things selected by the groups. Each presentation will be strictly for ten minutes as I had already mentioned earlier, but it would be preferable if you take seven to eight minutes so that we have at least one or two minutes of some very quick observations by people. But we all agree that for such group exercises that will be done at the remote centers, we will ask a different peer review group to review the assignments which are done by someone so that there will be less of a confusion and conflict. So the group zero, Harshad Gune is here, who is going to make a presentation? Yeah, so Prasad Gune for the group zero, you have ten minutes, your time starts now. Good morning everybody, on behalf of the group coordinator of 1040, 1130 and 1230 I am making this presentation on the first problem, the problem number zero, our problem was pretty simple in terms of introducing the students to the IFELS ladder. Incidentally, when we have just a small number of groups, four groups were there and out of those four groups, the three groups had identical problem, exactly the same problem of finding out the grade of a student based upon the percentage of the marks obtained by the student himself. So we chose that problem, we started off with one of the group has had this nice concept of presenting the learning objective for the particular topic or the particular session. So we picked up that learning objective as this particular session is going to cover the understanding the nesting of IFELS and also extending the IFELS into the IFELS ladder. So this is the learning objective that we would like to present. We assume here that the students, they are already aware of the IFELS and they can easily write the programs with single if and else statements. So this is our problem statement where we say that you write a C program in C or C++ where the user will input the percentage of marks and we have specified a set of criteria which will determine what the grade the student is going to have. So this particular problem, it really does not have too much of a conceptual algorithm design in terms like introducing the new concepts. So we are just explaining here that how you could approach the finding out the grade of individual students. So we are first reading the marks, then we must also here introduce the concept of validating your inputs. So we are checking that okay whether the marks are entered or within the limits. So comparing them with the values 0 and 100 as prescribed by the problem statement. And then we are eliminating the criteria one by one. So we are checking for 75, obviously those falling below 75 they need to be checked for 60, those who are not falling I mean falling below 60 they need to be checked with 50, those who are falling below 50 they need to be checked with 40 and so on. Now the same algorithm which was written in simple English, we are presented in a pseudocode form. So this is how the pseudocode will look like where the parameter or the input value to this algorithm would be the percentage which will be entered and then we are validating it and subsequently the pseudocode is explaining the same logic. And here is our program written in the C++. So if you could explain it here like we would need one variable to accept the percentage or percentage can be in fractions in real numbers. So we emphasize on choosing a float type of a variable. Then we provide a prompt to the user that what he or she is supposed to do. So we provide the message to enter the marks, we read the marks. Subsequently as per the algorithm we are validating the marks entered by the user, the percentage of the marks entered by the user and the logic is flowing as described earlier. We are explaining that okay with this we have eliminated one part that is above 75. So for those conditions where the students are having marks less than 75, it will come into the else part. In the else part again we need to check for the next condition that say whether the marks are greater than 60. Now we have already eliminated the people above 75. So this naturally means that people between 75 and 60 they would be given this rating. If now the marks are less than 60 the flow would fall below in the else part of that. Where again we are checking one condition where now it limits the conditions between 60 and 50 and likewise the program proceeds till the last case where the student is announced to be fed. We got several quizzes so I'm just presenting the two of them. One is based upon the principle concept of the structured programming where it talks about in structured programming the e-fills. So what kind of a structure it represents, whether it's a sequence structure or a selection structure or iteration. And obviously the correct answer would be the B, the selection structure. So here when it writes we just provide a straight away feedback as yes is one of the control structure but not the only control structure which could be used. However you could also specify the other control structures are XYZ. The wrong answer is obviously we need to emphasize that a sequence control doesn't involve branching. So we need to provide a feedback which specifies that whereas in sequence structure control flows sequentially and here the statement's without branching. And also the wrong answer C which is iteration control, where iteration control essentially emphasizes that going back and here in the e-fills you really don't go back but simply execute the block and continue further. The next problem is we are given some example, numerical example kind of a thing the students are expected to evaluate this. It's specifically not indented. The reason behind is the people should understand the association of the else with the appropriate if even if the programs are not really indented. Because the invitation really doesn't serve though it's a good practice to do. And then we are providing the four different options and based upon the value the students would be given the appropriate feedback explaining okay why this is going to be a wrong answer or why this this particular going to be wrong answer and so on. That's all. Thank you for patient listening. Hold your class because I'm going to request all the members of the groups to kindly stand up who contributed to this thing. So if you can just stand up all the members of all the groups which did this assignment. Let's give them a big hand. Thank you. I would like to thank all my group members for helping me and giving this opportunity to be here to present this and also I would like to thank Phataksar and his team that this was a very wonderful experience that I ended up learning so many new things though many of the things we were practicing yet there were a lot more for me to take back home from here. Thank you. It's one small thing. I would suggest that you can go back and do this. Please examine each and every sentence of the final writer. And I would request all the groups which did this assignment should do because they are all visible now. I will make all of them visible on the on the model and try to correct any small mistake that you find including any mistake in English. For example, I just noticed one thing that when you say congratulations your first class etc. All that makes sense. But sorry you are failed was the word used. Actually you have failed is the correct English. So from our side as teachers we should never we should make sure that everything is corrected as far as possible. So such thing not only here but in all subsequent thing I would suggest that you look in. Thank you. The next group one whosoever is presenting if they could kindly come up. Praveen Gupta has uploaded it. Good morning everybody. I am Praveen Gupta presenting problem number one on behalf of my team. We are the six members in the team and we have done a review of all the problems which we have received. It is the same like case three problems were on the same topic. That was a calculator which is most widely used for the all the teaching purpose. And the three groups made the problem statement same as the calculator. One was from the hotel. One is from related with the your total problem and one was undefined. Out of these three we have done analysis like this one. This RC code number then problem statement analysis of this algorithm design what they have written then code what the problem we have found quiz one and quiz two. This is the clear analysis of all these three all these six projects. And out of that all were anonymously agree on the project submitted by me 1181 and my team members. Now I will take a detail of this project. Another statement which we have finalized this is the calculator which adds addition, subtraction, multiplication and division and we are using the switch statement to explain it to the students. Number one algorithm we are writing it in the text form start then take two real numbers number one number two from the user display different options next take choice of arithmetic operations to be performed on number from users. Then if desired operation is addition then perform result one equals to number one plus number two and display result after that if desired operation is subtraction then perform a subtraction option by subtracting two numbers. Next if number is chosen is multiplication then we will do the multiplication and subsequently we will continue. And we have even if on the division operation if number two is zero then we will handle it divide by zero error and draw by the result here care has been taken if the time of division if number is zero we will take care of this one. After that we have made a flowchart you can see it start then enter value one and two after that we have given four choices true and false then result of that one and this is the complete flowchart and at last we are displaying result and stop of the error here if any error then display message and if divided by zero error then display this is zero. While writing the code for this we have taken care so enough that only switch statement is used no other statement or no other command line have been used so that it is easy to understand to the users or our students that they understand the functionality of switch statement starting with declaration of variables then we have defined clearly to why we have taken the variables and given a command there to what the variables are doing there. After that we are receiving two input from the user user is entering and before that one we have given out a statement which is mentioning the enter two numbers as soon as number is entered here at C in number one C2 number is added entered by the user after that a menu will be displayed and we have given a either command that the menu is code for menu is written at this point of time. As menu is coming it is showing four options addition, subtraction, multiplication, division and similarly adjacent to that respective sign have been displayed so that the user or your student can see the sign and select the appropriate sign and after that one switch statement is coming switch and choice and there are four cases which plus minus you see division and multiplication signs. In each switch cases we have given the what is the operation is going on there and after that for example in the plus case we have given first command after that the result and the output of the result after that break a statement given. So in each four cases plus minus subtraction division a clearly visible command and code has been given and output has been displayed on the screen. After that it is coming at the last at the default default if anything is wrong is entered then it will come to the default statement and programs ends with the return zero. In this program we have used only the switch case nothing else and the student can understand what is the functionality of switch case very easily going through the code reading the commands and by executing this one. After that we have taken the questions two questions the first question here we have taken int a integer variable a then a float b equals to 4.0 in the switch we are writing a equals to b plus 1 in the case case is case 5 and 5.0 we are given slight tricky one then output 5 and 5.0 and then one is default the output of this will be in compilation error because here we are in switch cases 5.0 has been used which is not allowed floating is not allowed here so there is one tricky question. In another question we are writing character ch equals to a and in switch case we are accepting input inside switch case we are using case 65 and case a now the output of this end default here a is equal to the 65 so in this case there will be a compilation error again because switch in the inside the switch statement we are using two times the same case because a will be 65 will be converted into we are given the explanation of this one and this is the explanation of a and answer will be the compilation error for this case will be these are the two questions which will select this is from my side thank you for all thank you very much good effort may again request all the contributors of solutions to this group to kindly stand up thank you so much before I invite the next person I would like to mention one thing that you might also think of setting up a quiz or an additional thinking activity on the problem that you are given or the example that you make you for example if the next letter I'm talking about the 0th group you could easily ask a question what happens if I reverse the order of the statements so effectively you will start getting each and every class for that person because every value will be larger than 40 larger than 50 larger than 75 etc etc and larger than 0 if somebody has a logic similarly in this particular case one question that I have is what happens to the program if when you are actually doing the addition multiplication division operation if the divisor is 0 what happens that is the second number given the input value is 0 then what happens to the program is a moot question now ordinarily people won't give it but it would be an interesting idea to give that question after answer you give an additional food for thought what happens if the input value is 0 indicating something else etc it just occurred to me so I thought I'd share it thank you so much may I request group number two to come over please Good morning to everyone on the behalf of seven co-ordinators team I Dharmendra Bhattak with Professor Riji will demonstrate the overall concept to demonstrate the concept of while loop and do while loop so what we have done we have just taken two different programs one is for while loop and from some other team team members and second program for demonstrating do while loop for some other team members so these are the basically co-ordinators name and along with their group members first I've demonstrated while loop so we have basically selected this problem because this problem demonstrate a very practical scenario scenarios quite simple like we have we all are basically assigned a four digit code that is our RC code so in this problem we will take a number from the user and we will accept the last digit from that number on the basis of last digit we will assign a hostel to particular user okay so input to this particular program will be like number of hostels available and and number of participant so while loop will iterate this is a basically algorithm so will be taking input from the user that is a hostel number of hostels available and number of participants then while loop gets executed and one by one we will take a participation participant ID like one two two one we will extract the last digit by taking mod of total number of hostels available like one two two zero mod suppose four so the reminder will be zero so hostel zero does not make any sense so we have just incremented by one so hostel one will be assigned to that particular candidate one thing which is to be to be explained is we are assigning hostel not rooms we are only assigning hostels not rooms because if we basically if we assign a room also in that case we require array so array is basically different concept which is assigned to different team so we are not using so this is basically code code is quite simple as a concept is quite simple here we are just taking a number of hostels available then number of participant then while loop basically iterate number of participant times here is a basic logic hostel number is basically mod of participation ID with hostel number of hostels available so as I explained suppose you are given one one two two zero so mod four equal to zero reminder will be equal to zero but hostel zero does not make any sense to be just incremented by one so hostel one will be assigned to one double zero participant this is the output hostels available for five participant like one two two zero hostel allotted to one and similarly and for demonstrating the second concept that is do I look and I'll be inviting professor we do so through his example he explained he demonstrated how the while you can be used and what we did is how we can able to differentiate between the functionality of while loop and do I look through another example and our problem statement says that to draw that the problem asked for a number from the user and that many number of circle should be drawn on the screen and we use the turtle program concept and here what we did was we created two can versus in one canvas we demonstrated the result of while loop and another can was we demonstrated the result of do while loop and we have taken two scenarios the first scenario was if the user gives an input and three that three number of circle has to be drawn and in both while loop and do while loop will draw three circles take the next scenario so if the input to zero the do I loop prints one one circle and the while loop so prints nothing and in this case the result we can compare the result that the precondition is checked in the case of while loop the post condition is checked in the case of while loop. So let me invite that we explain the quiz questions okay so out of 14 MCQ questions we have selected two best MCQ questions so first question is what will be displayed in an output when the following code is get executed it's a basically while best problem so like counter is equal to 1 while counter plus plus is equal to 5 so these are the like outputs 1 2 3 4 5 compilation error 7 so we have specifically mentioned what should be the output and why and what their particular option is not being the output like first is 1 2 3 4 5 so because of counter plus plus it will not print this second one is compilation errors because of the semicolon at the end of while loop as you can see while counter plus plus is equal to 5 semicolon so student may think it may it may be like compilation error but it is not the case so why we have placed a particular option as an option so we have just specified the reason 7 7 is the correct answer and 6 because loop will not get will be successful executed until the condition is false so counter is like 6 so this one is first problem second problem means which one of these logics is suitable to extend the given problem to find the reverse of a number by using while iteration one group member has I have to say that one group member has spent more than one hour to form this problem and he has successfully executed in the number of times so I think that's a good contribution to date and CQ so this is a problem in which we are using while loop it's being assumed so we have not written that while loop again and again we have just coded the logic like digit one equal to number mod hundred and something so we will be having four options and after the end of those those options we have basically explained why it is the right option why it is the wrong option like in the first one we are taking mod of hundred so it will only expect a single digit similarly second in third and fourth one so this is how we have contributed thank you very much so once again let me request all the contributors of all the group members kindly stand up please so we can acknowledge all of you please remain standing for a minute because the camera is capturing all of you turn by turn right thank you so much I particularly like the description which also includes what output you would get how many circles you would get etc etc that kind of explanation as a part of our content would be very useful for the students as an explanation thank you so group three please very good morning to all the problem was first to demonstrate a loop to the class and for this one of our group members have done a nice thing he has made what is a loop first made a small note first so you can find out what is loop he has described and with a small illustration and all the credit goes to this revered Daniel he has made this first explain what is loop and then a problem out of many problems we have just formulated one problem actually iteration and loop this is a mathematical problem and more computer introduction people introduce this induction method in their class 1112 as primarily we have assumed that we are not going to take it in the first class as most of the people are opposing that it should be a simpler one on other things first primary goal was that why iteration and why this induction method has been masked into that iteration system so we have just designed one a story like thing four friends started business with a capital 5000 1050 and 20 rupees each they are all in the same business the business policy compels them to follow a business rules that every time they do any deal they have to follow there was one equation maybe due to this conversion of document it has been omitted one plus square root of their capital write a program to illustrate the situation for n such business deals consider capital amount as integer and consider capital amount as float to situations when I first floated this all the group members shouted this is a complex problem loko so much in here they will be distracted and everyone said why this type of problem is there and we do cannot came out to any conclusion till yet but till the problem is presented out here so after this we found out some algorithmic approach as natural the algorithm was just represented but the objective so the objective was to find out the values that what will happen if people are not finding out the induction or iterative method what where they are merging they will miss out so I am just quoting here Samir Sathya Buddhisar's presentation he just mentioned one golden rule and golden ratio actually this is whatever has been said in other way it's a golden ratio or golden rule so there is in our objective we have used here for those with extra effort interest continue reading that we will be also planning the same thing in our class because as Pataks are also said the advanced students they will bore out in the class so for them there is a challenging part and those who want to skip it they can skip there is a total explanation how the value of phi has been found out with this loop of loop iteration or you can say induction method so this is taken from Wikipedia and there is a complete explanation so there is a nice thing if people are starting their business or anything with a large number of capital and small number of capital this method shows that after 3-4 business deal all will be having the same capital so graphical you can find out after some portion whatever is capital immaterial you will be having the same capital so that was a complex explanation then we tried to formulate the program and here it is the program first we design the program using array then many of our members subjected why you have introduced array this is a for loop problem okay then it has been updated that we have made with ABCD fixed numbers and simple lines of code but the output is very interesting when we run the program for iteration of seven times we have found after third iteration all of they are merging to 2 when the value of n a capital we have assumed as integer that means after fourth iteration all values will be merging to same whatever immaterial you started with and more interestingly if you give a floating value after 13 iteration again you are merging to same that means the convergence problem so by this you can both show the loops because the code you have seen a simple one line code but the output is very interesting which covers the mathematics which also covers the computation and also there are some game theory you can relate with the ability of the students and lastly when you go on gone for this quiz question the quiz question was like this that after seven such deals who among the friends will be the richest if a person understand the programming logic and if you understand because many of people are objecting that they will run and they find out because they are writing during examination they cannot assume that what will happen after seventh iteration so obviously the answer is last one and second quiz question it was just came in our mind suddenly that when we declare integer a 500 like that how many big number we can give because we have observed machine to machine compiler to compiler these varies enormously and true students challenge us so what is the number if this question is coming into our example that what is the maximum number of n you can give how we are going to answer personally I have not landed up to any solid question so these are some of the options and yet it is open for the audience even if someone wants to edit up that what should be the more correct answer only at the last I have given a justification that though very only it is dependent on operating system architecture and others but the question is very silly integer a five lakh five thousand what number I can put and even if it is a multi-dimensional array what should be the lending up so that's why we have learned a lot and the way back to our institutes we can make this peer evolution really one of the practicing for our purpose thank you all and personally thanking the whole team I would think wonderful work may request the contributors to stand up please my compliments may I request the presenter of group 4 to come in a very good afternoon to each and every group members and participants who are sitting over here and I on behalf of my group member I'm here to present one interesting activity which we found to be a good enough so with support and effort of my group members we came up with some interesting problem and the problem statement that we have selected for this is that let us consider an auditorium with incapacity people just like ours where people are seated arbitrarily in random order well if we take our own example here each and every participant is seated according to their RC codes but we assume that we take one auditorium with incapacity people where each and every student or where each and every participant is seated randomly not in a particular sequence and we assume that each person has a unique identity code that is ranging from 1 to n now the problem statement is that we need to find out the sequences of identity code of people who are seated at consecutive seats also to find out the total number of such sequences so we simply have to write down a C plus plus program to implement the other problem to find out the total number of sequences of ID code and in order to display those number of occurrences of those sequences now why we have selected this particular problem statement that in this because that we came upon a very practical application of choosing this particular problem statement like I'll ask you to consider a scenario of examination where different branch students this sit according to their role numbers and all the branches this sit randomly or in a mixed arrangement now in order to search out for a particular branch arrangement of student we can go for this particular problem statement so let me first discuss the algorithm design for my problem statement so initially I'll take the input that is the total number of people sitting in the auditorium and in the next step I'll be entering the ID codes of all the people who are sitting in the auditorium now in order to find the sequence or the sequence of the ID codes that are sitting consecutively we need to compute the difference between every two adjacent ID codes now if the difference comes out between any two adjacent ID codes to be one that means the two ID codes are in a sequential order or they are in a sequence otherwise they do not form a sequence so for each sequence found we have to increase the counter by one and this will give the total number of sequences found in an auditorium so let's see the program design so initially we'll take the input n and we'll just enter the n ID codes now initially we have to set the counter variable count as well as I to 0 and we need to repeat steps 5 and 6 while I is less than n minus 1 now we are running this loop for n minus 2 times because the last comparison that will be performing will be between n minus 1 and n minus 2 that's why we are running this loop up to n minus 2 times so initially we take a temporary variable pos that is denoting the position where we found a particular sequence and initially it is initialized to minus 1 and we just compute the difference between the two consecutive ID codes now if difference comes out to be one then simply we have to set j equals to 0 and we have to repeat this entire loop until this difference comes out to be a non-zero value so we'll be taking a temporary array in which we'll be copying all those sequences which are in consecutive order so after computing the sequence we simply need to print that sequence and will increment the counter by 1 so this is the program which we have made in C++ so this program is all about finding the sequences of the number as well as the number of occurrences of ID codes in the auditorium so initially we have given n ID codes and we have computed the difference between every adjacent ID codes now we have used the loop to compute the difference between every ID code and if the difference comes out to be one between the two consecutive locations then it gives a sequence and once we find a sequence we have to simply increment the counter by 1 okay one of my team mate Mr. Sande will be discussing the mcqs with you yeah good morning to one and all so here you can observe two questions which are optically one thing is for the representation of addressings and the second one is for the identification of the addressing value of an array the first one is so if you find the difference of the first element that is let us consider array a where it will be having the ith element that means the option here we'll be having a star i next a plus i minus one that will end the third option is a star i minus one and a plus i here in this question if you observe clearly whatever the location which we will be finding will be the multiple the addition of the ith value will be having the perfect address location and whereas considering the second one what is the index of the lost element of an array with nine elements that means so initially if we start an array the initial assignment will be starts from zero that's why the answer here will be it's eight so these are the two questions which we are selected from out of 14 questions thank you thank you very much again may i request all the contributors to this problem for to kindly stand up thank you so much again i will request all of you they have as many as 14 quiz problems they have just presented two but there is no reason to believe that the other quiz problems are not as interesting or as useful and in fact all of this material including things similar things which will be submitted by ten thousand teachers would go all go into the consortium or the repository of all the composite knowledge that all teachers will be creating i hope that will be useful to all of us may i request the next group dear friends we have got a programming problem called the uses of two-dimensional arrays first of all let me thank my group members all the five group members and the professor for this great opportunity write a c program to store an image we selected a problem like an image processing here not a very great image processing is done we have just stored an image in the form of not a bit math but i would say a binary map in the sense zeros and ones are used to represent a matrix and therefore we have created an image which is a tick mark we have done the following functionalities in that to copy the image to transpose the image to reflect the image on a mirror placed horizontally below the image to reflect the image on a mirror placed on vertically on placed vertically by the side right side of the image and now here is the description of the algorithm we just declared the array like this and the binary array is set up like that it shows a small tick mark whereas we used a 20 by 20 array to represent the entire tick mark we have done certain exercises like the original matrix is copied into a matrix called a copy and then the original matrix is transposed to the copy matrix and then reflection is made and it is also given to the copy matrix and in each case the result is printed with a proper delay i would like to just execute this code we have that code you get the different shapes after reflection or transpose reflection on the right side reflection at the bottom and so on at the bottom of the screen we see clear and display are two user defined functions and they are very simple functions which will be very enlightening for the students to understand certain things clear can be just 24 lines new lines and this delay can be just a loop and using a delay like that helps the students to understand a misplaced semicolon at the end of the loop can destroy everything that you wanted to do certain very important things i wanted to or we wanted to communicate to the students are as follows one r and c are used for i and j in the place of row and column so that students can immediately understand what is r standing for and c standing for also row and column for end values to which this r and c shall ride up to and here is a code the first one i mean for simplicity's sake we have just made a copy as general one global one and then clear function is very simple 24 lines are new lines are drawn and delete or delay function is just a nested loop counting too much reflection on on the base row is done just by changing the row at the 0th place and at the 19th place and then on 1th place and the continuously changing the row values for 0 to 19 rest of the functions i am not going to display right now i'm going to the main see a very important point is stressed here in the main usually where anywhere a matrix program is given or any array program is given everywhere the students try starting scanning entire values are scanned say a zoodoo resolver eight nine by nine 81 rows and column 81 values they tried scanning i have seen that or given a program a into b two matrices to be multiplied they scan all the values all through wasting all their time and then at the end they find it very difficult to check whether the answer is right or not whereas a method of hard coding giving the values into the matrices in the beginning itself and trying to get the correct result then changing it to a scan f it will be a very practical approach here in this case because this is very big array it is even impractical to have a hard coded values therefore we have given two loops which will be giving the different values for the ones at various required places for those two for loops actually initialize the entire array afterwards there is a print matrix to understand that this matrix is is what we expected later there is a copy matrix we make sure that a copy is all also there and it is also correct after displaying the copy matrix also then we go to transposing after the transpose is made we immediately display this at this point i would like to say there are certain important points which we follow in our place which is called incremental programming many students tend to write the entire program at one stretch and then compile and see what are the areas whereas at each step we compile see whether it is working and then only we proceed and that is called the incremental programming which we follow very much in our place and various other things are the various reflections are there finally here is the quiz tough questions are asked there so that the students can understand the inner realities behind this two-dimensional arrays first question in which always can two-dimensional arrays be represented in a computer it can be row major column major or a or b none of the above obviously it is a or b depending upon the operating system question number two in how many ways two-dimensional arrays can be accessed in c plus plus where i and j stand for row and column hey ij i of aj content at content at a plus i plus j and a b or c obviously all the three are right a b and c are right and the third one among the following in which always a two-dimensional array can be received in a called function as the formula parameter int a of four int a three four int a boxes and then integer pointer four and you may be i mean it would be surprising to see that accept the c all the three are right i would say we had a very great teachers very wonderful teachers in our groups and because of their cooperation we could arrive at immediate conclusions and we worked on that we could not submit it because of the technical problems i just wanted to explain why this problem is a good problem for analysis that is this is an image visual effect is there and the flip on the major diagonal reflect on the right reflect on the left reflect on the top and so on this in turn we ignite the curiosity of the students to do the following like magnifying the image or translating the image to remove a portion of the image or to rotate the image and so on this increases the passion of programming by the students at this point i would like to stop thank you very much may i request all the group to stand up please group members so has anybody already tried the sudoku matrix that we are suggesting no that's not here the next group please but also everybody this is narish choudhary from rcid 1296 i'm here to present the topic related functions our problem is very simple it tells where functions are necessary why functions are necessary so we have taken a problem that is computing ncr permutations and combinations so here we are going to use factorial function the formula of ncr is n factorial by n minus r factorial into r factorial so there we are going to use factorial function for three times so this is the algorithm main algorithm so where we accept valid values for n and r so here we need to validate n and r there are three conditions we need to check n should be greater than 0 or can be greater than or equal to 0 and one more condition is n should be greater than or equal to r these three conditions should be validated before computing ncr value so here it is the factorial function we used loop for computing factorial so this is very simple and this is our program design so the problem with the factorial is it can compute up to 12 factorial maximum because we have taken unsigned long in to hold that value for the result and for taking n and r we have taken integer type so we have taken one more variable ch so i will explain it later now this is a function declaration it is very clear unsigned long in will be the written type and factorial is the name and it takes one parameter int which is of type now this is the expression that is result equal to factorial of n by factorial n minus r star factorial r now this is the factorial function so initially we take f as 1 so condition loop x greater than 0 this is the condition f equal to x f star x x minus minus finally it computes factorial finally we are going to return f value now this is our program source code now this is the declaration and in main function we are going to declare nr ch and result which is of type unsigned long in now here this while loop we have taken to read n and r values so while one we have taken infinite loop so here enter c out enter n and r values so it prompts for n and r so by using seen we are going to read n and r so by using if statement we are checking three conditions one is n less than or equal to 0 or less than 0 or n less than or if any one of this condition is true then it leads to invalid n and r values now if this is true any one of the condition is true then it prints invalid input values and one more it prompts for do you want to continue s or no so if you give s so that character will we are reading using seen and again we are going to check what is the input character that you are giving you do want to continue or not that is again by using one more if so if why is the character that is given then it is going to continue means so next to loop starts next iteration starts because it is infinite loop again it will ask for enter n and r if you don't want to continue then you can press n or any other character it will go to else it means exit one we are going to exit from program so if this is false if this is false means n r values are valid values then it is it will come to else so there we are going to write break that means we are quitting from infinite loop so now after coming back after coming from while loop so here we are going to calculate factorial of n factorial of n minus r factorial of r by calling factorial function three times so factorial of n for this this function is called there x is formal parameter and we are taking one local variable one so we are initializing it to one and while x greater than zero so f equal to f star x x minus minus and it will compute factorial so first initially factorial of n next factorial of n minus r factorial of r finally corresponding factorial value will be returned here and this expression is computed and our result will be n c r value now by using c out i'm going to print n c or n is n value i'm going to print c c i'm going to print r r value equal to the result where i'm going to print now this is our program so here we are not forcing the user to give n and r values if they are invalid we are giving option whether you want to continue or not that that's what we did and in peace questions simple question that is formal parameters of the function can be used in the first option is anywhere in the program second option is anywhere in the function third anywhere outside the program anywhere outside the function now the correct answer will be anywhere inside the function because they are defined in local scope formal parameters of a function are local scope now the second way second one is so how many maximum written statements can a function have so options are zero one two and many so what will be the option can anybody many yes so why it is many means we can write many written statements in a function but it can execute only one written statement it can execute only one written statement now this is all about functions thank you the contributors to stand up please thank you all of you i think as the assignment number increases people go higher up in the physical order is it that is how the things have come out all right thank you so much i would just like to correct here a small problem when you say it can execute only one written statement is technically not correct it can execute any one of the many it will execute only one of the many statements but when you say it can execute only one statement there are doubts about the capability of c plus plus but thank you very much i like the idea by the most of the people are doing that that in this sample program the validation checks are introduced and the expenses are given and this will encourage our students to look at because students generally try to ape whatever we show them so these kind of things will encourage them to do good program thank you so much the next group is group seven good morning everybody so what is group seven and here we have got four groups working together out of these four groups three have presented the same problem so before this i'm taking a biological example to explain the concept please go through the slide here we are taking a example of a honeybee sound how it family tree grows there are some facts the fact one queen is a special bee which only produces eggs but others are the workers and they don't produce eggs the second one male is produced by a queen's unfertilized egg but whereas a female is produced when a queen mates with a male so a male has got only one parent whereas a female has got both male and a female together so we are now relating this concept to somewhere here so the green one shows you it's a male and the red one is a female so if it is a green one it is a male then it has got only one parent right now it is a female when then it has got two parents likewise if you look into the number of generations after n generations you would like to count the number of bees involved so for example if it is a generation three how many bees were involved there you can get it from the slide generation three it was two plus above right so likewise i am trying to add the previous iterations into this to come out with the number of bees that was involved in a particular generation i think from this you can make out what is the thing that i'm going to explain since most of you might have known this what is the thing that i'm explaining here i'm trying to explain the concept of Feminacy series as i said no the other name given to it yeah Viranka number or Hemchand series right so that is what i am trying to explain here so instead of i'm saying that please tell me the 20th number instead of that i'm giving the problem like this find out the number of bees in a family tree for a male be up to 20 levels here nothing but the 20th generation or the 20th number in the series so this is what the problem that i'm going to post to my students now looking into the concept that i have taken to explain this is a recursion as we all know recursion is nothing but a function calling itself so the same recursion is going to be added to my Feminacy number again the nth number is equals to the sum of the previous two numbers right this is the algorithm itself very simple steps then looking into the Feminacy series here we have written a program and my friend is going to explain you in detail about this program in fact this is a simple program Feminacy series we implemented using recursion so same thing can also be implemented using non-recursion technique and especially non-recursion technique it takes less time but especially recursion if you don't optimize it is going to take longer time so that is what we wanted to emphasize for the student so there are two different approaches are there first approach it is going to take an exponential time and other one is going to take that linear time in the previous lecture already sir explained us how to reuse that in Hemchandra problems are already told how to reuse that already solved problem so in that case what we are doing is second problem is reusing that existing solution so that's why it is going to take less time and we wanted to show that both the functions are being implemented and we'll show you the results so this is the execution i think it is not very clear but i'll just tell you that in bottom you can see that that first program is going to take about for 46 terms because 47 terms term is going to generate as negative number because it is going to going beyond the limit so that's why we are executing up to 46 term the first algorithm it takes about 200 seconds and second one is taking 0.05 seconds so there is a difference about 40 000 times so because basically both are we are going to solve the same problem but the time difference is 40 000 times so this is the magnitude so that's what we wanted to more emphasize and in fact i read the tester that while going through this problem and if you want to go to up to 100 terms and it's going to take about 10 000 crores years so that will have to highlight the students and suppose if you want to solve it in linear time it will not it will take only few milliseconds so that is the time gap so that we wanted to emphasize using this and we use two different approaches and next we have two key problems and basically this is the problem we selected because this is especially by seeing this in fact i also got confused yesterday i was thinking that it is going to produce a binary number so for given decimal number it is going to produce a binary number because most of the time our first year students they solved that conversion problem and but it will not show you that binary number it give you a reverse binary number so that that's why we selected and b is the right answer and this is the last problem we selected this is a power function in power function this is a specialized power function it computes only square cube fourth power like that and this is the simplified one and especially for beginners so this might help them and we wanted to test that after after kth iteration how many time that procedure is being called and see is the correct answer okay thank you very much for giving us this opportunity very good thank you very much may i request the contributors to stand up please it's a good problem i must compliment our friends for thinking about illustrating a very important concept that recursion is extremely important to conceptualize solutions but terrible to implement the kind of execution time that you would take thank you so much the next group is oh group is good afternoon friends my topic is pointers and i'm very thankful to my team members rashmi edwin raut and gladis the first thing is what is the problem definition it's a very simple problem definition because i'm going to write the program for simple telephone directory this telephone directory will have two attributes that is the name of the subscriber and the number of the subscriber the only thing is students should get the concept of pointer how to get the pointer and how to illustrate the concept of pointer by using this example first thing what is a pointer the pointer the variable which stores the address of another variable then for example integer x is equal to 44 this is the variable declaration at that time a compiler will assign memory to this variable that is the variable is name given to the memory location and at that memory location the 44 will be stored and that memory location will have some address that is for example 1645 so how pointer works pointer is a variable storing an address as it is then for example i is equal to 5 this is the variable declaration integer star pointer is the pointer of type integer and which stores the address of variable i when i'm printing the value of i it will print five but when i'm printing the value of star pointer that is star ptr it will also print the value five because it is storing the address of i variable that is shown in this figure next this is the actual problem design name array is given and phone number array into that there are two fields that is the one first field is address and second one is value the pointers are pointing to each location in name array and in second the pointer two is used for the traversing purpose this is the simple algorithm where you we are getting the name and phone number from the user we are storing that in array and the input will be name to be searched or phone number to be searched in that directory if the value is a name compare the name with each entry of the name in the list with the help of pointer and if match found we have to display the respective phone number and if it is not then display person not found the same thing with the phone number also i don't want to repeat this next program implementation here the most important thing is long int phone number and character name name is array used for the storing the person name and yes name is used for the name to be searched in the directory the same thing yes phone is used for the phone number to be searched in the directory pointer two is pointing to a phone number and pointer one is pointing to the name of the person that is for to the first array then for look is used for taking the input from the user and that is stored in the array of name and phone number next then by using the next for loop the all the addresses of the first array are assigned to the pointer first that is for the traversing purpose and next the same thing pointer two is having the base address of the phone number array next we are taking the name to be searched in the array and that is compared with the first entry that in the first iteration of the loop that is compared with the first entry in the directory next if it is found then loop will be break otherwise the pointer will be traversed to the next entry if i is equal to n it means that we have to traverse the whole directory that is number of comparisons will be n that is if the k is equal to 0 k is number of occurrences of the entry in the array is equal to 0 then n is equal to k this is the algorithm for linear search we have implemented those thing here then the same thing is happening for the phone number we are taking the phone number input and we are checking whether that phone number is present in this directory with the help of pointer that is pointer two we are going to increment the pointer two plus plus it denotes the increment in the address of the address that is stored by the pointer two next is we are taking the choice from the user whether he want to repeat the same thing over here this is all about the program next quiz is it's more simple quiz integer a is having 10 20 30 40 this is the array a integer star p p is equal to a see out we are printing the value of star p any guess about this yes this is very simple answer address of first element so it is a 10 and it will not be 20 30 or 40 next question it is having the more level of difficulty it adds the difficulty in the first program integer a is equal to 10 20 30 40 integer star p p is equal to ampersand a of zero that instead of this you can write p is equal to a it will store the base address see out star plus plus p see out plus plus star p okay the answer is 20 21 okay then first option is correct and others are wrong answers so thank you very much thank you may i request the contributors to stand up please thank you good job it just occurs to me that it might be a good idea to use some extremely simplified animation it's not a character animation something while explaining both the movement of array indexes and the array values access as well as the pointer arithmetic so when you change the pointer for example the incrementing of the pointer is not by one but as many bytes as the storage capacity that is indicated by the pointer i have found often people don't find it easy to appreciate that concept so you couldn't we could draw those number of bytes and show a counter a pointer changing value and then actually pointing to something else that could be useful but very good effort thank you very much and now the last group group nine good afternoon everybody on behalf of all my group members i am here to present about this topic that is given to us that is a character string we have chosen one problem here i would like to read the whole problem statement it is just like a situational problem i think all of you are able to read that also arun nair gets admitted to iit bombay so now you may be thinking who is arun nair it is the the person who is who is computer i am using since last five days in the akash lab one so we have been alerted one on system so it is written there he's a junior programmer there and a room in hostel is being alerted the hostel has a r number of rooms where in each room two students can stay there are n number of students staying in the hostel and there is a anthakshiri competition has to be there so some group needs to be formed consisting of two participants and the rule for forming the group is that the name of the participants belonging to the same group must not start with the same letter so typically it is a string problem so we have chosen this now as arun is a good programmer this task has been assigned to him to write a program which will form n by two groups because his group can have maximum two number of participants from n number of students where two students name should not be starting from the same letter now another thing is that when you will allocate the group one at some point of time it may like that none of the students or some students will be there whose names are starting with the same letter and who has not been alerted any group so in that case we can go for the second character and if the same thing continues then again you can go for the third character or like that this is the simple problem we have to form the groups among the students now again we are proposing here one challenging version that two participants must not be from the same room so again one constant can be added and also another thing can be added the number of members in a group can be specified by the user we are considering here each group can be exactly two number of members will be there so it can be given by the user and accordingly the group can be formed so this is the algorithm we have to another thing what we have earlier done we have taken a structure structure of the students where three members are there the name the room number and the group number but again as structure has not been taught so we have simply taken r a here r a consisting of three dimensions and we have to initialize the r a this is a while you while not of the students are being assigned a group so we have to go on checking the character if the first character of the first student and first character of the second student are not same and their groups has not been alluded then assign a group number to them and increment the group number and so both these for loop here will go on assigning the groups to the students and again we are checking if any on assigned students is there why because the name of the first characters are same then again it will go for another iteration and it will continue like this so you can see the program here so only one loop is there we have taken one simple what initialization here the name the room number and group number is blank we have initially taken them blank and this is the do while loop and this is the two for loop so we are checking the character position we are taking here so this will be incrementing from 0 1 to like this so in the first character is not matched and that so we are using the library functions here like str cmp to compare and another thing we have used here that is because group we are taking a numeric variable integer variable and r a that we have taken is of string so we have to convert this integer to string so we are using this function s printf which will convert this integer to string and we are assigning the group by using the str cpo here then you are changing this group number and once the group is being assigned then we are just breaking the loop then we are checking here that whether any of the student is there who has not been assigned a group and if all are assigned then while not all groups are assigned the loop will continue and to display we are using another function here that is for i o manipulation that z w so that the output will be coming properly and that's all this program and these are two again which questions are there which is illustrating the str cpo function because str cpo is will take that the according to the syntax it will copy this to this like second argument to the first argument so suppose the question is given that you have to copy this hello to str1 but in the function call it is written str and str1 so this is wrong means str will not be containing any value and the existing value will be overwritten here so this is logically incorrect and second question we have taken generally again this is here the r a size has been specified it is of 16 and here r a size is not been specified so it will automatically take according to the number of characters what is there and we are printing the size size of this a and b so it will be 16 and here it will be six because six characters are there so that's all from our group anything any question is there then it is thank you very much may i request the members to stand up please the contributors but i would like to raise one question you have said in that quiz logical error so do you expect the compiler or the program in executed to actually print logical error so what will it print no it will not print anything it will not print anything it will actually print a junk in my opinion garbage value garbage value so the the correct choice is not logical error because then people will assume that it will print the string logical error str1 has to be printed so it will print garbage value so in fact the explanation should be that it should print the garbage value and the word garbage may not be clearly understood so whatever value exists in str1 will be printed yes i'm not this so the next question what if str1 actually has a tr hello or something they will print that yes it may print the same so it it it may not be garbage in fact the most dangerous program outputs are those which look correct but which come because the incorrect reason so that's a possibility so maybe that last line could be modified instead of saying that last choice that is logical error instead of logical error of course the analysis correct thank you very much for this okay now a couple of things before we break for lunch first of all i want to know your reaction to my using this method of activities in the workshop where group individuals do some assignments but more importantly groups do some assignments and then groups discuss that assignment and then they come up with some solution do you believe that it it makes better sense to do that i i picked up this strategy i learned it from professor sridhar iyer and it is exactly like extending a share in fact having convinced myself that it is the activity and experiment and practice by students which make them learn more i thought the same thing holds good for us teachers as well so if we experience and practice we will actually learn better how to coordinate the workshop back now i i hope you agree that this process has told us what to do and what not to do with the groups of teachers who will come at our place and if we do a similar experiment with them then they will also understand better what to do and what not to do with the students we can only encourage them to do certain things what are they eventually do will be all right so we'll follow this model okay thank you so much