 Welcome to this session of the course computer programming. In this session, we shall look in some details at Mr. Dumbo's computations. You will recall that last time we introduced Mr. Dumbo or Mr. Budhuram Dumbo as a caricature, but a caricature which represents a conceptual model of the computer. We saw that Mr. Dumbo has tools with which he can perform input, output and assignment operations. We defined how to write a program for Mr. Dumbo. We described the instructions to be given to Mr. Dumbo for input, output and assignment operations. And last but not the least, we saw how a declaration can be given to Mr. Dumbo as part of our program to announce names used in our program. In this session, we will actually see how Dumbo executes a program. While Dumbo executes a program, we will notice that there are some problems in handling input, output particularly when it relates to collecting values from us and giving output values to us. We will also find a solution. So, let us begin. We start with another computational problem. Given the number of boys and girls in a class, find the total number of students in the class. Now, of course, this is an elementary school problem. Two numbers are given and we have to find out the total of these two numbers. We can write the program straight away for such a simple problem, but it is useful to do what is known as program design. We identify what exactly is given, we identify what exactly is to be calculated, how it is to be calculated and we identify what exactly is to be output by the program. So, let us see. We notice that we need to read two input values. So, let us use the names n boys and n girls for these values. We could have used a, b, p, q, anything, but it is useful to use names which are meaningful in the context of the problem that we are solving. Since we are talking about number of boys and number of girls, it perhaps makes better sense to use a name like n boys and n girls. Next, we need to calculate one result which is the total number of students. So, let us use the name n students to represent the results. Now, the value that is to be assigned to n students is nothing but the sum of n boys and n girls. So, we figure that we will need to do an assignment operation to do this calculation. The program can now easily be written. Here is a program. Input n boys, input n girls, n students equal to n boys plus n girls, output n students. Notice that each instruction is terminated by a semicolon as we had agreed. Looks like a complete program, but wait for a minute. If we give this program to Mr. Dumbo, when Mr. Dumbo starts executing the first instruction, input n boys, he will ask us who is n boys. You never told me you are going to use this name. Please remember, we had agreed to use a declaration instruction. If we include that, a program will look like this. Use locations n boys comma n girls comma n students. Indeed, it is this declarative which makes Mr. Dumbo take these names and put them as tags on three memory locations. The rest of the program, of course, is very easy to understand. Let us see what happens when Dumbo executes this program. First, Mr. Dumbo looks at the declarative instruction which says use locations n boys, n girls and n students. What should Mr. Dumbo do in response to this? It will look at the first name n boys, put a tag on one drawer, then looks at the next name n girls, puts the tag n girls on the second drawer. That is the same thing with the last name n students. So, he now has three named memory locations, one corresponding to each. Next, he executes an input instruction. He collects the value 12, opens the drawer for n boys. He finds some old value there. Observe that when he inserts this new value 12, the old value disappears. This is because a memory drawer can contain only one value at a time and when you put some new value, the old value disappears or is displayed. He again now goes to collect an input for number of girls and he gets the value 28 for example. He opens the location for n girls. Again, he finds some old value sitting in that drawer. He replaces that old value with the new value 28 which has obtained from the input instruction. This completes the first two instructions of Mr. Dumbo. Next, he has to execute this assignment operation. Please note that this has two parts. The right hand side part requires n boys plus n girls. So, what he does is, he opens the location for n boys, takes the value 12 and puts it in a register. Notice that he is not putting anything in n boys, but taking a value out. When you take a value out, you actually copy it. So, the original value remains in the location. Same thing with n girls. It has a value 28. When he copies that value, the original value still remains. So, for calculation, when you take a value, it is not a destructive operation. Having got both these values on his workbench, now he proceeds to do the calculation represented by this symbol plus. So, he will calculate the sum total of 12 and 28 to get the value 40. Now, he looks at the left hand side of the assignment operation and it notes that it has to put the value of n students into this location. So, the new value 40 is now inserted in the location for n students. Finally, he has to execute the output instruction, output n students. He opens the drawer, makes a copy of the value 40. Notice that he is not putting something in, but taking something out. And taking something out always means copy the existing value, but let the original value remain inside. He will now take this value 40 and bring it back to us as the output. This completes the execution of the program by Mr. Dumbo. In summary, using Mr. Dumbo, we have understood basic operations that a computer can carry out. In the process, we have also seen the major components that a real computer is likely to have. It will possibly have memory, it will have input output capabilities and perhaps a set of registers for computation. We of course do not know for sure, but it is quite likely that a real computer which has to compute exactly the same way that Dumbo does should have these components as well. Finally, we have seen through an animation how Mr. Dumbo executes a program that we write for him. Thank you.