 Welcome back, in the previous segment we discussed general ways of specifying conditions. In this segment we are going to take a large, a largest program example, it is not going to be, it is actually going to be small but it will actually do something, in that sense it is a large example, it is a full program which does something. So what we want to write is a different way of controlling the turtle. What do I mean by this, well here is what I mean. So write a program which reads in commands from the user and accordingly controls the turtle. So the way the turtle moves is not specified in the program but the user tells how the turtle moves by typing in programs. So if the user types F then the turtle should execute forward 100. If the user types right then the turtle should turn right 90. If the user types L the turtle should turn left by 90 degrees. This is just some rules that I made up. You could have made up a different set of rules and you will be encouraged to make a more interesting or nicer rules later on in exercises. And this whole thing should stop after 100 commands are executed. Why 100? Again just a number that I made up. So again this program by now should appear reasonably obvious. So we are going to have a character which we will call command and then we will start the turtle simulator and then since we want to execute 100 commands then we will have a loop which will repeat 100 times. Then we will read in each iteration we will read in into command. So depending upon what the user types command will have that value. If the user typed F and F went into command then we will execute forward 100. If the user typed R then we will execute right 90. If the user typed L we execute left 90. Otherwise and when will this be executed? Well if the user typed some other letter maybe the user typed G. In that case we will help out the user by saying that look you typed something which is not a proper command and we will tell the user what command he or she typed and this will repeat 100 times and that will be the end of the program. So let us do a demo of this. So what is this program? This is the program that I have just showed you nothing else. So let us compile it. Let me just type out the program. So this is the program that I showed you and now let me compile it. Now let us run it. Let me adjust it so that. So now let us say we type F. So the turtle has moved forward 100. So let us say I type R. The turtle has turned right. Maybe I will type an F again. It has gone forward maybe I type another F. It has gone forward further. So maybe I will hit R again so it has turned right and I will type F and instead of hitting enter immediately maybe I will type F two times or three times. Let us see what happens. So it has actually taken three commands. So it has done F three times and maybe I can turn left here. So it has turned left and it can go on in this manner. So I am not going to go through 100 times but you see that the program is doing exactly what we wanted. So let me break out of it. So we just did this demo and let me now give you an exercise. So the exercise is write a program that reads a number and prints one if the number is a multiple of five but not of three and otherwise prints zero. And you are encouraged to write this in as many different ways as possible. So for example you could write this using only simple conditions. So for example you could write something like you could only have conditions of the form expression one equal to equal to expression two or whatever or not equal to or greater than or equal to or so on. But here you may have to put if statements nested inside one another. So inside say a consequent or an alternate you may have to have an if statement or you can use a single if then else statement with a compound condition. So this is really an exercise for learning the if statement and different ways of expressing the same program using different possibilities that the language gives you. Alright so what did we discuss in this segment? We discussed a detailed program, a detailed program example. Next we are going to discuss the switch statement and logical data but before that let us take a quick break.