Difference between revisions of "KTurtle/C3/Programming-Concepts/English-timed"
From Script | Spoken-Tutorial
Line 1: | Line 1: | ||
{|border =1 | {|border =1 | ||
− | + | |'''Time''' | |
− | + | |'''Narration''' | |
+ | |||
|- | |- | ||
− | ||00 | + | ||00:01 |
||Hello Everybody. | ||Hello Everybody. | ||
|- | |- | ||
− | ||00 | + | ||00:03 |
||Welcome to this tutorial on '''Programming concepts''' in '''KTurtle'''. | ||Welcome to this tutorial on '''Programming concepts''' in '''KTurtle'''. | ||
|- | |- | ||
− | ||00 | + | ||00:08 |
||In this tutorial, we will learn how to | ||In this tutorial, we will learn how to | ||
|- | |- | ||
− | ||00 | + | ||00:12 |
||Write a program in KTurtle | ||Write a program in KTurtle | ||
|- | |- | ||
− | ||00 | + | ||00:15 |
||Use variables to store user input | ||Use variables to store user input | ||
|- | |- | ||
− | ||00 | + | ||00:18 |
||Use print command to print on canvas | ||Use print command to print on canvas | ||
|- | |- | ||
− | ||00 | + | ||00:22 |
||Comment a line | ||Comment a line | ||
|- | |- | ||
− | || 00 | + | || 00:24 |
||To record this tutorial, I am using,Ubuntu Linux OS Version 11.10. KTurtle version 0.8.1 beta. | ||To record this tutorial, I am using,Ubuntu Linux OS Version 11.10. KTurtle version 0.8.1 beta. | ||
|- | |- | ||
− | ||00 | + | ||00:37 |
||We assume that you have basic working knowledge of '''KTurtle'''. | ||We assume that you have basic working knowledge of '''KTurtle'''. | ||
|- | |- | ||
− | ||00 | + | ||00:43 |
||If not, for relevant tutorials, please visit our website, '''http://spoken-tutorial.org'''. | ||If not, for relevant tutorials, please visit our website, '''http://spoken-tutorial.org'''. | ||
|- | |- | ||
− | ||00 | + | ||00:49 |
||Before proceeding, we will discuss some basic information about '''KTurtle'''. | ||Before proceeding, we will discuss some basic information about '''KTurtle'''. | ||
|- | |- | ||
− | ||00 | + | ||00:55 |
||"Turtle" displayed on the canvas is called "sprite". | ||"Turtle" displayed on the canvas is called "sprite". | ||
|- | |- | ||
− | ||01 | + | ||01:00 |
||"Sprite" is a small image that moves around the screen.e.g. Cursor is a sprite. | ||"Sprite" is a small image that moves around the screen.e.g. Cursor is a sprite. | ||
|- | |- | ||
− | ||01 | + | ||01:10 |
||"spritehide" command hides '''Turtle''' from canvas. | ||"spritehide" command hides '''Turtle''' from canvas. | ||
|- | |- | ||
− | ||01 | + | ||01:15 |
||"spriteshow" command shows '''Turtle''' if it is hidden. | ||"spriteshow" command shows '''Turtle''' if it is hidden. | ||
|- | |- | ||
− | ||01 | + | ||01:21 |
||"clear" command cleans all drawings from canvas. | ||"clear" command cleans all drawings from canvas. | ||
|- | |- | ||
− | ||01 | + | ||01:27 |
||In '''KTurtle''', | ||In '''KTurtle''', | ||
|- | |- | ||
− | ||01 | + | ||01:29 |
||"$ " sign is a container of variables. | ||"$ " sign is a container of variables. | ||
|- | |- | ||
− | ||01 | + | ||01:34 |
||"*"(asterisk) is used for multiplication of two numbers. | ||"*"(asterisk) is used for multiplication of two numbers. | ||
|- | |- | ||
− | ||01 | + | ||01:41 |
||"^"(caret) raises a power of the number. | ||"^"(caret) raises a power of the number. | ||
|- | |- | ||
− | ||01 | + | ||01:45 |
||"#"(hash) sign comments a line written after it. | ||"#"(hash) sign comments a line written after it. | ||
|- | |- | ||
− | ||01 | + | ||01:50 |
||"sqrt" is an inbuilt function to find square root of a number. | ||"sqrt" is an inbuilt function to find square root of a number. | ||
|- | |- | ||
− | ||01 | + | ||01:58 |
||Let's open new '''KTurtle''' Application | ||Let's open new '''KTurtle''' Application | ||
|- | |- | ||
− | ||02 | + | ||02:02 |
||Click on '''Dash home >> Media Apps'''. | ||Click on '''Dash home >> Media Apps'''. | ||
|- | |- | ||
− | ||02 | + | ||02:07 |
||'''Under Type, Choose Education''' and '''KTurtle'''. | ||'''Under Type, Choose Education''' and '''KTurtle'''. | ||
|- | |- | ||
− | ||02 | + | ||02:13 |
||'''KTurtle''' application opens. | ||'''KTurtle''' application opens. | ||
|- | |- | ||
− | ||02 | + | ||02:20 |
||We can also open '''KTurtle''' using '''terminal'''. | ||We can also open '''KTurtle''' using '''terminal'''. | ||
|- | |- | ||
− | ||02 | + | ||02:24 |
||Press '''CTRL+ALT+T''' simultaneously to open the terminal. | ||Press '''CTRL+ALT+T''' simultaneously to open the terminal. | ||
|- | |- | ||
− | ||02 | + | ||02:30 |
||Type '''KTurtle''' and press enter, '''KTurtle''' Application opens. | ||Type '''KTurtle''' and press enter, '''KTurtle''' Application opens. | ||
|- | |- | ||
− | ||02 | + | ||02:41 |
||Let me type and explain the program code. | ||Let me type and explain the program code. | ||
|- | |- | ||
− | ||02 | + | ||02:46 |
||Let me zoom into the program text, it may possibly be a little blurred. | ||Let me zoom into the program text, it may possibly be a little blurred. | ||
|- | |- | ||
− | ||02 | + | ||02:55 |
||'''#program to find square of a number'''. Press enter | ||'''#program to find square of a number'''. Press enter | ||
|- | |- | ||
− | ||03 | + | ||03:15 |
||"#" sign comments a line written after it. | ||"#" sign comments a line written after it. | ||
|- | |- | ||
− | ||03 | + | ||03:19 |
||This means, this line will not be executed while running the program. Press enter. | ||This means, this line will not be executed while running the program. Press enter. | ||
|- | |- | ||
− | ||03 | + | ||03:29 |
||'''reset''' | ||'''reset''' | ||
|- | |- | ||
− | ||03 | + | ||03:30 |
||reset command sets Turtle to default position. Press enter. | ||reset command sets Turtle to default position. Press enter. | ||
|- | |- | ||
− | ||03 | + | ||03:38 |
||'''$i= ask''' within double quotes '''enter a number for i and click OK'''. | ||'''$i= ask''' within double quotes '''enter a number for i and click OK'''. | ||
|- | |- | ||
− | ||03 | + | ||03:58 |
||"$i" is a variable to store user input. | ||"$i" is a variable to store user input. | ||
|- | |- | ||
− | ||04 | + | ||04:03 |
||'''“ask”''' command asks for user input to be stored in variable.press enter | ||'''“ask”''' command asks for user input to be stored in variable.press enter | ||
|- | |- | ||
− | ||04 | + | ||04:11 |
||'''“fontsize”''' space '''28'''. | ||'''“fontsize”''' space '''28'''. | ||
|- | |- | ||
− | ||04 | + | ||04:17 |
||'''fontsize''' sets the font size used by print. | ||'''fontsize''' sets the font size used by print. | ||
|- | |- | ||
− | ||04 | + | ||04:20 |
||Fontsize takes number as input, set in pixels. | ||Fontsize takes number as input, set in pixels. | ||
|- | |- | ||
− | |04 | + | |04:27 |
||'''print $i*$i''' | ||'''print $i*$i''' | ||
|- | |- | ||
− | ||04 | + | ||04:36 |
||'''print $i*$i''' calculates and prints square of a number. press enter. | ||'''print $i*$i''' calculates and prints square of a number. press enter. | ||
|- | |- | ||
− | ||04 | + | ||04:45 |
||'''spritehide''' | ||'''spritehide''' | ||
|- | |- | ||
− | ||04 | + | ||04:48 |
||'''spritehide''' hides '''Turtle''' from canvas. | ||'''spritehide''' hides '''Turtle''' from canvas. | ||
|- | |- | ||
− | ||04 | + | ||04:53 |
||Let us Run the program now. | ||Let us Run the program now. | ||
|- | |- | ||
− | ||04 | + | ||04:56 |
||Click on the '''Run''' button on the toolbar to start execution of the code in the editor. | ||Click on the '''Run''' button on the toolbar to start execution of the code in the editor. | ||
|- | |- | ||
− | ||05 | + | ||05:03 |
||It shows a list of execution speeds. | ||It shows a list of execution speeds. | ||
|- | |- | ||
− | ||05 | + | ||05:07 |
||'''Full speed(no highlighting and inspector)''' | ||'''Full speed(no highlighting and inspector)''' | ||
|- | |- | ||
− | ||05 | + | ||05:10 |
||'''Full speed''', | ||'''Full speed''', | ||
'''slow''', | '''slow''', | ||
Line 181: | Line 182: | ||
'''step-by-step'''. | '''step-by-step'''. | ||
|- | |- | ||
− | ||05 | + | ||05:17 |
||Let me run the code at '''slow''' speed. | ||Let me run the code at '''slow''' speed. | ||
|- | |- | ||
− | ||05 | + | ||05:21 |
||An "input bar" appears | ||An "input bar" appears | ||
|- | |- | ||
− | ||05 | + | ||05:23 |
||let's enter 15 for i and click OK | ||let's enter 15 for i and click OK | ||
|- | |- | ||
− | ||05 | + | ||05:29 |
||square of '15' = '225' is displayed on the canvas. | ||square of '15' = '225' is displayed on the canvas. | ||
|- | |- | ||
− | ||05 | + | ||05:35 |
||Let's now learn to find nth power of a number through a program. | ||Let's now learn to find nth power of a number through a program. | ||
|- | |- | ||
− | ||05 | + | ||05:42 |
||I already have program in a text editor. | ||I already have program in a text editor. | ||
|- | |- | ||
− | |05 | + | |05:46 |
||Let me copy the program from text editor and paste it into '''KTurtle''' editor. | ||Let me copy the program from text editor and paste it into '''KTurtle''' editor. | ||
|- | |- | ||
− | ||05 | + | ||05:56 |
||Please pause the tutorial here and copy the program into your '''KTurtle''' editor. | ||Please pause the tutorial here and copy the program into your '''KTurtle''' editor. | ||
|- | |- | ||
− | || 06 | + | || 06:03 |
||Let me zoom into the program text. | ||Let me zoom into the program text. | ||
|- | |- | ||
− | ||06 | + | ||06:07 |
||Explain the program. | ||Explain the program. | ||
|- | |- | ||
− | |06 | + | |06:09 |
||# sign comments a line written after it. | ||# sign comments a line written after it. | ||
|- | |- | ||
− | ||06 | + | ||06:13 |
||'''reset''' command sets '''Turtle''' to '''default''' position. | ||'''reset''' command sets '''Turtle''' to '''default''' position. | ||
|- | |- | ||
− | ||06 | + | ||06:18 |
||'''$i''' and '''$n''' are variables to store user input. | ||'''$i''' and '''$n''' are variables to store user input. | ||
|- | |- | ||
− | ||06 | + | ||06:25 |
||'''“ask”''' command asks for user input to be stored in variables. | ||'''“ask”''' command asks for user input to be stored in variables. | ||
|- | |- | ||
− | ||06 | + | ||06:31 |
||'''fontsize 28''' sets the font size used by print. | ||'''fontsize 28''' sets the font size used by print. | ||
|- | |- | ||
− | ||06 | + | ||06:37 |
||Fontsize takes number as input, set in pixels. | ||Fontsize takes number as input, set in pixels. | ||
|- | |- | ||
− | ||06 | + | ||06:43 |
||'''print ($i^$n)''' calculates & prints nth power of a number. | ||'''print ($i^$n)''' calculates & prints nth power of a number. | ||
|- | |- | ||
− | ||06 | + | ||06:52 |
||'''spritehide''' hides '''Turtle''' from canvas. | ||'''spritehide''' hides '''Turtle''' from canvas. | ||
|- | |- | ||
− | ||06 | + | ||06:57 |
||Let's run the program. | ||Let's run the program. | ||
|- | |- | ||
− | ||07 | + | ||07:00 |
||Let's enter '5' for i, and click OK | ||Let's enter '5' for i, and click OK | ||
|- | |- | ||
− | ||07 | + | ||07:05 |
||Let's enter '4' for n, and click OK. 5^4=625 is displayed on canvas. | ||Let's enter '4' for n, and click OK. 5^4=625 is displayed on canvas. | ||
|- | |- | ||
− | ||07 | + | ||07:18 |
||Next, let's use inbuilt '''“sqrt”''' function in a program to find square root of a number. | ||Next, let's use inbuilt '''“sqrt”''' function in a program to find square root of a number. | ||
|- | |- | ||
− | ||07 | + | ||07:27 |
||Let me copy the code from editor and paste it into ''' KTurtle's''' editor. | ||Let me copy the code from editor and paste it into ''' KTurtle's''' editor. | ||
|- | |- | ||
− | ||07 | + | ||07:35 |
||Please pause the tutorial here and copy the program into your '''KTurtle''' editor. | ||Please pause the tutorial here and copy the program into your '''KTurtle''' editor. | ||
|- | |- | ||
− | ||07 | + | ||07:43 |
||Let me zoom the program text it may possibly be a little blurred. | ||Let me zoom the program text it may possibly be a little blurred. | ||
|- | |- | ||
− | ||07 | + | ||07:49 |
||Let me explain the code. | ||Let me explain the code. | ||
|- | |- | ||
− | || 07 | + | || 07:52 |
||# sign comments a line written after it . | ||# sign comments a line written after it . | ||
|- | |- | ||
− | ||07 | + | ||07:57 |
||'''reset''' command sets '''Turtle''' to '''default''' position. | ||'''reset''' command sets '''Turtle''' to '''default''' position. | ||
|- | |- | ||
− | ||08 | + | ||08:02 |
||'''$i''' is a variable to store user input. | ||'''$i''' is a variable to store user input. | ||
|- | |- | ||
− | ||08 | + | ||08:07 |
||'''fontsize 28''' sets the font size used by print. | ||'''fontsize 28''' sets the font size used by print. | ||
|- | |- | ||
− | ||08 | + | ||08:12 |
||'''print sqrt $i''' prints square root of a number. | ||'''print sqrt $i''' prints square root of a number. | ||
|- | |- | ||
− | ||08 | + | ||08:19 |
||'''spritehide''' hides '''Turtle''' from canvas. | ||'''spritehide''' hides '''Turtle''' from canvas. | ||
|- | |- | ||
− | ||08 | + | ||08:24 |
||Let me run the program now. | ||Let me run the program now. | ||
|- | |- | ||
− | ||08 | + | ||08:28 |
||Let's enter '169' for i, and click OK | ||Let's enter '169' for i, and click OK | ||
|- | |- | ||
− | ||08 | + | ||08:34 |
||square root of 169 = 13, is displayed on canvas. | ||square root of 169 = 13, is displayed on canvas. | ||
|- | |- | ||
− | ||08 | + | ||08:39 |
||Let's run again, | ||Let's run again, | ||
|- | |- | ||
− | ||08 | + | ||08:42 |
||let's enter -169 for i and click OK. | ||let's enter -169 for i and click OK. | ||
|- | |- | ||
− | ||08 | + | ||08:49 |
||If we enter negative number, output is ''''nan'''' it means not a number. | ||If we enter negative number, output is ''''nan'''' it means not a number. | ||
|- | |- | ||
− | ||08 | + | ||08:56 |
||As square root of negative number is not a real number. | ||As square root of negative number is not a real number. | ||
|- | |- | ||
− | ||09 | + | ||09:02 |
|| let's next evaluate Cube root of a positive number through a program. | || let's next evaluate Cube root of a positive number through a program. | ||
|- | |- | ||
− | ||09 | + | ||09:08 |
||Let me copy the program from editor and paste it into ''' KTurtle's''' editor. | ||Let me copy the program from editor and paste it into ''' KTurtle's''' editor. | ||
|- | |- | ||
− | ||09 | + | ||09:19 |
||Please pause the tutorial here and copy the program into your '''KTurtle''' editor. | ||Please pause the tutorial here and copy the program into your '''KTurtle''' editor. | ||
|- | |- | ||
− | ||09 | + | ||09:25 |
||Let me zoom into the program text it may possibly be a little blurred. | ||Let me zoom into the program text it may possibly be a little blurred. | ||
|- | |- | ||
− | ||09 | + | ||09:31 |
||Let me explain the program. | ||Let me explain the program. | ||
|- | |- | ||
− | ||09 | + | ||09:35 |
||# sign comments a line written after it. | ||# sign comments a line written after it. | ||
|- | |- | ||
− | ||09 | + | ||09:38 |
||Please note this is a single line comment. | ||Please note this is a single line comment. | ||
|- | |- | ||
− | ||09 | + | ||09:42 |
||Every comment must be preceded by a # sign. | ||Every comment must be preceded by a # sign. | ||
|- | |- | ||
− | ||09 | + | ||09:48 |
||'''reset''' command sets the '''Turtle''' to '''default''' position. | ||'''reset''' command sets the '''Turtle''' to '''default''' position. | ||
|- | |- | ||
− | ||09 | + | ||09:53 |
||'''$i''' and '''$C''' are variables to store user input. | ||'''$i''' and '''$C''' are variables to store user input. | ||
|- | |- | ||
− | ||09 | + | ||09:59 |
||'''$C=($i)^(1/3)''' calculates cube root of a number. | ||'''$C=($i)^(1/3)''' calculates cube root of a number. | ||
|- | |- | ||
− | ||10 | + | ||10:07 |
||'''fontsize 28''' sets the font size used by print. | ||'''fontsize 28''' sets the font size used by print. | ||
|- | |- | ||
− | ||10 | + | ||10:13 |
||'''print $C''' prints cube root of a number. | ||'''print $C''' prints cube root of a number. | ||
|- | |- | ||
− | ||10 | + | ||10:19 |
||'''spritehide''' hides '''Turtle''' from canvas. | ||'''spritehide''' hides '''Turtle''' from canvas. | ||
|- | |- | ||
− | ||10 | + | ||10:23 |
||Let's Run the program | ||Let's Run the program | ||
|- | |- | ||
− | ||10 | + | ||10:27 |
||Let's enter 343 for i and click OK | ||Let's enter 343 for i and click OK | ||
|- | |- | ||
− | ||10 | + | ||10:34 |
||cube root of 343 = 7 is be displayed on canvas. | ||cube root of 343 = 7 is be displayed on canvas. | ||
|- | |- | ||
− | ||10 | + | ||10:40 |
||With this we come to the end of this tutorial. | ||With this we come to the end of this tutorial. | ||
|- | |- | ||
− | ||10 | + | ||10:43 |
||let us summarize. | ||let us summarize. | ||
|- | |- | ||
− | ||10 | + | ||10:46 |
||In this tutorial, we have learnt | ||In this tutorial, we have learnt | ||
|- | |- | ||
− | ||10 | + | ||10:49 |
||Programming concepts | ||Programming concepts | ||
|- | |- | ||
− | ||10 | + | ||10:52 |
|| Use of sqrt function | || Use of sqrt function | ||
|- | |- | ||
− | ||10 | + | ||10:55 |
|| Use of print command | || Use of print command | ||
|- | |- | ||
− | ||10 | + | ||10:57 |
||Using KTurtle editor and canvas. | ||Using KTurtle editor and canvas. | ||
|- | |- | ||
− | ||11 | + | ||11:02 |
||As an assignment, I would like you to use basic programming commands to find ... | ||As an assignment, I would like you to use basic programming commands to find ... | ||
|- | |- | ||
− | ||11 | + | ||11:08 |
||Cube of a number | ||Cube of a number | ||
|- | |- | ||
− | ||11 | + | ||11:11 |
|| nth root of a number | || nth root of a number | ||
|- | |- | ||
− | ||11 | + | ||11:15 |
||Watch the video available at this URLhttp://spoken-tutorial.org/What is a Spoken Tutorial | ||Watch the video available at this URLhttp://spoken-tutorial.org/What is a Spoken Tutorial | ||
|- | |- | ||
− | ||11 | + | ||11:19 |
||It summarises the Spoken Tutorial project | ||It summarises the Spoken Tutorial project | ||
|- | |- | ||
− | ||11 | + | ||11:22 |
||If you do not have good bandwidth, you can download and watch it | ||If you do not have good bandwidth, you can download and watch it | ||
|- | |- | ||
− | ||11 | + | ||11:27 |
||The Spoken Tutorial Project Team : | ||The Spoken Tutorial Project Team : | ||
|- | |- | ||
− | ||11 | + | ||11:29 |
||Conducts workshops using spoken tutorials | ||Conducts workshops using spoken tutorials | ||
|- | |- | ||
− | ||11 | + | ||11:32 |
||Gives certificates to those who pass an online test | ||Gives certificates to those who pass an online test | ||
|- | |- | ||
− | ||11 | + | ||11:35 |
||For more details, please write to contact@spoken-tutorial.org | ||For more details, please write to contact@spoken-tutorial.org | ||
|- | |- | ||
− | ||11 | + | ||11:44 |
||Spoken Tutorial Project is a part of the Talk to a Teacher project. | ||Spoken Tutorial Project is a part of the Talk to a Teacher project. | ||
|- | |- | ||
− | ||11 | + | ||11:48 |
||It is supported by the National Mission on Education through ICT, MHRD, Government of India. | ||It is supported by the National Mission on Education through ICT, MHRD, Government of India. | ||
|- | |- | ||
− | ||11 | + | ||11:55 |
||More information on this Mission is available at this http://spoken-tutorial.org/NMEICT-Intro ]. | ||More information on this Mission is available at this http://spoken-tutorial.org/NMEICT-Intro ]. | ||
|- | |- | ||
− | ||11 | + | ||11:59 |
||This is Madhuri Ganpathi, from IIT Bombay signing off.Thank you for joining. | ||This is Madhuri Ganpathi, from IIT Bombay signing off.Thank you for joining. | ||
|- | |- |
Revision as of 14:18, 9 July 2014
Time | Narration |
00:01 | Hello Everybody. |
00:03 | Welcome to this tutorial on Programming concepts in KTurtle. |
00:08 | In this tutorial, we will learn how to |
00:12 | Write a program in KTurtle |
00:15 | Use variables to store user input |
00:18 | Use print command to print on canvas |
00:22 | Comment a line |
00:24 | To record this tutorial, I am using,Ubuntu Linux OS Version 11.10. KTurtle version 0.8.1 beta. |
00:37 | We assume that you have basic working knowledge of KTurtle. |
00:43 | If not, for relevant tutorials, please visit our website, http://spoken-tutorial.org. |
00:49 | Before proceeding, we will discuss some basic information about KTurtle. |
00:55 | "Turtle" displayed on the canvas is called "sprite". |
01:00 | "Sprite" is a small image that moves around the screen.e.g. Cursor is a sprite. |
01:10 | "spritehide" command hides Turtle from canvas. |
01:15 | "spriteshow" command shows Turtle if it is hidden. |
01:21 | "clear" command cleans all drawings from canvas. |
01:27 | In KTurtle, |
01:29 | "$ " sign is a container of variables. |
01:34 | "*"(asterisk) is used for multiplication of two numbers. |
01:41 | "^"(caret) raises a power of the number. |
01:45 | "#"(hash) sign comments a line written after it. |
01:50 | "sqrt" is an inbuilt function to find square root of a number. |
01:58 | Let's open new KTurtle Application |
02:02 | Click on Dash home >> Media Apps. |
02:07 | Under Type, Choose Education and KTurtle. |
02:13 | KTurtle application opens. |
02:20 | We can also open KTurtle using terminal. |
02:24 | Press CTRL+ALT+T simultaneously to open the terminal. |
02:30 | Type KTurtle and press enter, KTurtle Application opens. |
02:41 | Let me type and explain the program code. |
02:46 | Let me zoom into the program text, it may possibly be a little blurred. |
02:55 | #program to find square of a number. Press enter |
03:15 | "#" sign comments a line written after it. |
03:19 | This means, this line will not be executed while running the program. Press enter. |
03:29 | reset |
03:30 | reset command sets Turtle to default position. Press enter. |
03:38 | $i= ask within double quotes enter a number for i and click OK. |
03:58 | "$i" is a variable to store user input. |
04:03 | “ask” command asks for user input to be stored in variable.press enter |
04:11 | “fontsize” space 28. |
04:17 | fontsize sets the font size used by print. |
04:20 | Fontsize takes number as input, set in pixels. |
04:27 | print $i*$i |
04:36 | print $i*$i calculates and prints square of a number. press enter. |
04:45 | spritehide |
04:48 | spritehide hides Turtle from canvas. |
04:53 | Let us Run the program now. |
04:56 | Click on the Run button on the toolbar to start execution of the code in the editor. |
05:03 | It shows a list of execution speeds. |
05:07 | Full speed(no highlighting and inspector) |
05:10 | Full speed,
slow, slower, slowest and step-by-step. |
05:17 | Let me run the code at slow speed. |
05:21 | An "input bar" appears |
05:23 | let's enter 15 for i and click OK |
05:29 | square of '15' = '225' is displayed on the canvas. |
05:35 | Let's now learn to find nth power of a number through a program. |
05:42 | I already have program in a text editor. |
05:46 | Let me copy the program from text editor and paste it into KTurtle editor. |
05:56 | Please pause the tutorial here and copy the program into your KTurtle editor. |
06:03 | Let me zoom into the program text. |
06:07 | Explain the program. |
06:09 | # sign comments a line written after it. |
06:13 | reset command sets Turtle to default position. |
06:18 | $i and $n are variables to store user input. |
06:25 | “ask” command asks for user input to be stored in variables. |
06:31 | fontsize 28 sets the font size used by print. |
06:37 | Fontsize takes number as input, set in pixels. |
06:43 | print ($i^$n) calculates & prints nth power of a number. |
06:52 | spritehide hides Turtle from canvas. |
06:57 | Let's run the program. |
07:00 | Let's enter '5' for i, and click OK |
07:05 | Let's enter '4' for n, and click OK. 5^4=625 is displayed on canvas. |
07:18 | Next, let's use inbuilt “sqrt” function in a program to find square root of a number. |
07:27 | Let me copy the code from editor and paste it into KTurtle's editor. |
07:35 | Please pause the tutorial here and copy the program into your KTurtle editor. |
07:43 | Let me zoom the program text it may possibly be a little blurred. |
07:49 | Let me explain the code. |
07:52 | # sign comments a line written after it . |
07:57 | reset command sets Turtle to default position. |
08:02 | $i is a variable to store user input. |
08:07 | fontsize 28 sets the font size used by print. |
08:12 | print sqrt $i prints square root of a number. |
08:19 | spritehide hides Turtle from canvas. |
08:24 | Let me run the program now. |
08:28 | Let's enter '169' for i, and click OK |
08:34 | square root of 169 = 13, is displayed on canvas. |
08:39 | Let's run again, |
08:42 | let's enter -169 for i and click OK. |
08:49 | If we enter negative number, output is 'nan' it means not a number. |
08:56 | As square root of negative number is not a real number. |
09:02 | let's next evaluate Cube root of a positive number through a program. |
09:08 | Let me copy the program from editor and paste it into KTurtle's editor. |
09:19 | Please pause the tutorial here and copy the program into your KTurtle editor. |
09:25 | Let me zoom into the program text it may possibly be a little blurred. |
09:31 | Let me explain the program. |
09:35 | # sign comments a line written after it. |
09:38 | Please note this is a single line comment. |
09:42 | Every comment must be preceded by a # sign. |
09:48 | reset command sets the Turtle to default position. |
09:53 | $i and $C are variables to store user input. |
09:59 | $C=($i)^(1/3) calculates cube root of a number. |
10:07 | fontsize 28 sets the font size used by print. |
10:13 | print $C prints cube root of a number. |
10:19 | spritehide hides Turtle from canvas. |
10:23 | Let's Run the program |
10:27 | Let's enter 343 for i and click OK |
10:34 | cube root of 343 = 7 is be displayed on canvas. |
10:40 | With this we come to the end of this tutorial. |
10:43 | let us summarize. |
10:46 | In this tutorial, we have learnt |
10:49 | Programming concepts |
10:52 | Use of sqrt function |
10:55 | Use of print command |
10:57 | Using KTurtle editor and canvas. |
11:02 | As an assignment, I would like you to use basic programming commands to find ... |
11:08 | Cube of a number |
11:11 | nth root of a number |
11:15 | Watch the video available at this URLhttp://spoken-tutorial.org/What is a Spoken Tutorial |
11:19 | It summarises the Spoken Tutorial project |
11:22 | If you do not have good bandwidth, you can download and watch it |
11:27 | The Spoken Tutorial Project Team : |
11:29 | Conducts workshops using spoken tutorials |
11:32 | Gives certificates to those who pass an online test |
11:35 | For more details, please write to contact@spoken-tutorial.org |
11:44 | Spoken Tutorial Project is a part of the Talk to a Teacher project. |
11:48 | It is supported by the National Mission on Education through ICT, MHRD, Government of India. |
11:55 | More information on this Mission is available at this http://spoken-tutorial.org/NMEICT-Intro ]. |
11:59 | This is Madhuri Ganpathi, from IIT Bombay signing off.Thank you for joining. |
Contributors and Content Editors
Kaushik Datta, Madhurig, PoojaMoolya, Pratik kamble, Sandhya.np14, Sneha