Difference between revisions of "KTurtle/C3/Common-Errors-in-KTurtle/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 3: Line 3:
 
!Narration
 
!Narration
 
|-
 
|-
||00.01
+
|| 00:01
||Hello  and welcome to the spoken tutorial on '''Question Glues''' in '''KTurtle'''.
+
|| Welcome to this tutorial on '''Common Errors''' in '''KTurtle.'''
 +
|-
 +
|| 00:07
 +
||In this tutorial, we will learn about
 +
|-
 +
|| 00:10
 +
|| '''Syntax errors''' 
  
 
|-
 
|-
||00.08
+
|| 00:12
||In this tutorial, we will learn the following question glues '''and, not'''
+
|| '''Runtime errors''' and
 +
 
 
|-
 
|-
|| 00.16
+
|| 00:14
||To record this tutorial I am using,Ubuntu Linux OS Version 12.04. KTurtle version 0.8.1 beta.
+
|| '''Logical errors'''
 
|-
 
|-
||00.29
+
|| 00:17
||We assume that you have basic working knowledge of KTurtle and “if-else” statement in KTurtle
+
||To record this tutorial I am using,
  
 
|-
 
|-
||00.39
+
||00:20
||If not, for relevant tutorials, please visit our website. http://spoken-tutorial.org
+
|'''Ubuntu''' '''Linux''' OS version 12.04.  
 +
 
 
|-
 
|-
||00.46
+
|| 00:25
||Before proceeding, let me explain about question glue words.  
+
|'''KTurtle''' version. 0.8.1 beta.
 
|-
 
|-
||00.51
+
|| 00:31
||Question glue words enable us to glue small questions into one big question.
+
||We assume that you have basic working knowledge of '''KTurtle''' 
  
 
|-
 
|-
||01.00
+
|| 00:36
||“and”, “or” and “not” are some glue-words.Glue-words are used together with '''if-else''' conditions.
+
|If not, for relevant tutorials, please visit our website.  
 +
 
 +
'''http://spoken-tutorial.org'''
 
|-
 
|-
||01.11
+
|| 00:42
||Let's open a new''' KTurtle''' Application.
+
||Let's first define,  What is an error ?
 +
 
 
|-
 
|-
||01.15
+
|| 00:46
||Click on  '''Dash home'''.  
+
|'''Error''' is a mistake in a program that produces an '''incorrect''' or '''unexpected''' result.
 +
|-
 +
||00:55
 +
||First I will explain about '''"Types of errors".'''
 +
|-
 +
|| 01:00
 +
|| '''Syntax error''' is a '''violation of grammatical rules''', of a '''programming language'''.
  
 
|-
 
|-
||01.18
+
|| 01:09
||In the Search bar, type KTurtle.
+
|'''Compilation''' fails when a program has '''syntax errors'''.
  
 
|-
 
|-
||01.22
+
|| 01:15
||And Click on the  option.
+
|'''Syntax errors''' are easy to find and fix.
 +
 
 
|-
 
|-
||01.24
+
|| 01:22
||Let's begin the tutorial with glue word '''and'''.
+
|For Example:  
 +
 
 
|-
 
|-
||01.28
+
|| 01:23
||I already have a program in a text editor.  
+
|| '''Unmatched parentheses''', '''square  ''' and '''curly braces'''.  
 +
 
 
|-
 
|-
||01.33
+
|| 01:29
||Let me copy the code from the text editor and paste it into  '''KTurtle''' editor.  
+
|| Use of ''' variable''' that has not been '''declared'''.
  
 
|-
 
|-
||01.40
+
|| 01:34
||Please pause the tutorial here and type the program into your '''KTurtle''' editor.  
+
|| Missing '''quotes''' in '''strings.'''
 +
|-
 +
|| 01:38
 +
||Let's open a new '''KTurtle''' Application.
  
 +
|-
 +
|| 01:42
 +
|Click on  '''Dash  home'''. In the Search bar, type '''KTurtle.'''
  
 
|-
 
|-
||01.46
+
|| 01:48
||Resume the tutorial after typing the program.
+
|Click on the  '''KTurtle''' icon.
 
|-
 
|-
||01.50
+
||01:51
||Let me zoom into the program text.  
+
||Let's begin the tutorial with some types of''' syntax errors'''.
 +
|-
 +
||01:58
 +
||I already have a program in a text editor.  
 +
|-
 +
|| 02:02
 +
||To explain the '''error''' in the program, I will comment part of the code.
 +
|-
 +
|| 02:09
 +
||Here, I will comment the line
  
 
|-
 
|-
||01.52
+
|| 02:11
||It may possibly be a little blurred.
+
||'''$a=ask within double quotes "enter any number and click Ok"'''
 
|-
 
|-
||01.56
+
||02:19
||Let's look the code.
+
||I will use '''hash(#)''' sign to comment the line.
 
|-
 
|-
||01.59
+
|| 02:23
||'''reset''' command sets '''Turtle''' to its''' default''' position.
+
||I will copy the program from text editor and paste it into '''Kturtle's''' Editor.
 +
 
 
|-
 
|-
||02.04
+
|| 02:31
||Message in a program is given within double quotes after the keyword '''message " " '''.
+
|Pause the tutorial here and type the program into your '''KTurtle''' editor
  
 
|-
 
|-
||02.10
+
|| 02:37
||'''“message”''' command takes '''“string”''' as input.  
+
|Resume the tutorial after typing the program.
 +
|-
 +
|| 02:42
 +
||Let's click on '''Run''' button to run the program
 +
 
 +
|-
 +
|| 02:47
 +
|'''Complier''' shows the following error,
 +
 
 +
|-
 +
|| 02:50
 +
|''' variable "$a" was used without first being assigned  to a value.'''
 +
|-
 +
|| 02:57
 +
||Here the error is in line number 4.
  
 
|-
 
|-
||02.14
+
||03:02
||It shows a pop-up dialog box containing text from the string and also generates a beep for non null strings.  
+
||This is a '''syntax error'''. It occured, as the variable  'a' was not declared.
 
|-
 
|-
||02.24
+
|| 03:10
||'''$a, $b''' and '''$c''' are variables that store user input.
+
||So I will go to line number 2, remove the comment.
 
|-
 
|-
||02.30
+
|| 03:14
||'''“ask”''' command prompts for user input to be stored in variables.
+
|| I will copy the program from text Editor and paste it into''' KTurtle's editor'''.
 
|-
 
|-
||02.36
+
|| 03:23
||'''if(($a+$b>$c) and ($b+$c>$a) and ($c+$a>$b)''', checks the '''“if”''' condition.
+
||Let's click on '''Run''' button to run the program
  
 
|-
 
|-
||02.49
+
|| 03:27
||When the two questions glued with '''“and”''' are true, result is true.
+
|Enter '''6''' for '''a''' value and click OK
 +
 
 
|-
 
|-
|| 02.55 
+
|| 03:31
||'''if(($a !=$b) and ($b != $c) and ($c != $a))'' checks the ''if'' condition.
+
|Program runs without errors.  
 
|-
 
|-
||03.05
+
|| 03:35
||when ''''if'''' condition above is true, control moves into '''nested if''' block.
+
||I will clear the current program from '''KTurtle''' editor.
  
 
|-
 
|-
||03.12
+
|| 03:38
||It checks whether sides of triangle are unequal.
+
|Type '''clear''' command and '''Run''' to clean the canvas.
 
|-
 
|-
||03.17
+
||03:43
||'''fontsize 18''' sets the font size used by '''print''' command.  
+
|| let's next look at another error.
 
|-
 
|-
||03.22
+
||03:46
||'''go 10,100''' commands  Turtle to go 10 pixels from left of canvas and 100 pixels from top of canvas.
+
||I already have a program in a text editor.  
 
|-
 
|-
||03.35
+
|| 03:50
||'''print''' command displays the string after checking the if condition.
+
||Here the value of "'''pi'''" is '''predefined''' in KTurtle.
 
|-
 
|-
||03.41
+
|| 03:54
||'''else''' command checks '''else''' condition, when if condition in the block is false
+
||Let's delete the "'''$'''" sign in the program.
 
|-
 
|-
||03.48
+
|| 03:58
||'''print''' command displays the string after checking the '''else''' condition.
+
||I will copy the program from text editor and paste it into ''' Kturtle's Editor'''
 +
 
 +
|-
 +
|| 04:05
 +
|Pause the tutorial here and type the program into  your  '''KTurtle editor'''
 +
 
 +
 
 +
|-
 +
|| 04:11
 +
|Resume the tutorial after typing the program.
 +
|-
 +
|| 04:16
 +
||Let's Click on '''Run''' button to run the program.  
 +
 
 +
|-
 +
|| 04:19
 +
|'''Complier''' shows the following error,
 +
 
 
|-
 
|-
||03.54
+
|| 04:22
||'''else''' command checks the final condition.
+
|'''you cannot put “=” here'''
 
|-
 
|-
||03.57
+
|| 04:26
||Here'''else''' is checked only when above conditions are false.
+
||This error is in line number 2.  
 
|-
 
|-
||04.03
+
|| 04:30
||'''print''' command displays the string after checking the else condition. I will run the code to check all the conditions.  
+
||This is a '''syntax error''' it occured, as there is no '''container  of variable.'''
 
|-
 
|-
||04.12
+
|| 04:37
||'''Let's click on the''' Run''' button to run the program.
+
||Let's go back to the program replace the $ sign.
 
|-
 
|-
||04.15
+
|| 04:41
||A message dialog box  pops- up.Let me click OK.
+
||I will copy the program from text editor and paste it into '''KTurtle's''' Editor
 
|-
 
|-
||04.20
+
||04:49
||Let's Enter 5 for 'length of  AB' and click OK
+
||let's click on '''Run''' button to run the program.
  
 
|-
 
|-
||04.25
+
|| 04:53
|| 8 for 'length of  BC' and click OK
+
|Enter '''45''' for angle value and click '''OK'''
  
 
|-
 
|-
||04.29
+
|| 04:57
|| 9 for 'length of AC' and click OK
+
|Program runs without errors.
 +
|-
 +
|| 05:00
 +
||Let's remove one of the quotes of the string.
 +
|-
 +
||05:05
 +
|| I will Copy the program from text editor and paste it into '''KTurtle's ''' Editor
 +
|-
 +
|| 05:12
 +
||Click on  '''Run''' button to run the program
  
 
|-
 
|-
||04.33
+
|| 05:15
||'''“A scalene triangle” is displayed on the canvas.'''
+
|'''Complier''' shows the following error,
 +
 
 
|-
 
|-
||04.37
+
|| 05:18
||Lets run again.
+
|'''Text string was not properly closed, expected a double quote “ ” to close the string.'''
 
|-
 
|-
||04.40
+
|| 05:25
||A message dialog box pops up .Let me click OK.
+
||Here the error is in line number 2.  
 
|-
 
|-
||04.44
+
||05:29
||Lets Enter 5 for length of 'AB' and click OK,6 for length of 'BC' and click OK,  6 for length of 'AC' and click OK.
+
|| I will  go  back to line number 2 and replace the quotes.  
 +
|-
 +
||  05:34
 +
||I will copy the program from text editor and paste it into''' Kturtle's''' Editor
 +
|-
 +
|| 05:41
 +
||Click on '''Run''' button to run the program
  
 
|-
 
|-
||04.58
+
|| 05:44
||'''“ Not a scalene triangle”''' is displayed on the canvas.
+
||Enter '''45''' for angle value and click OK.
 +
 
 
|-
 
|-
||05.02
+
|| 05:49
||Let's run again to check default condition.  
+
|Program runs without errors.  
  
 
|-
 
|-
||05.06
+
|| 05:52
||A message dialog box pops up. Let me click ok.
+
|This way you can find the line at which error has occured, and also correct it.  
 +
|-
 +
||05:59
 +
||Let's now learn about runtime errors.
 
|-
 
|-
||05.11
+
|| 06:04
||Let's Enter 1 for length of 'AB' and click OK.
+
||'''Run-time error''' occurs during the '''execution''' of a program.  
  
 
|-
 
|-
||05.16
+
|| 06:10
||1 for length of 'BC' and click OK.
+
|It may '''crash''' the program when you run it.  
  
 
|-
 
|-
||05.20
+
|| 06:15
||2 for length of  'AC' and click OK.
+
|'''Runtime errors''' are commonly due to wrong input from the user.  
  
 
|-
 
|-
||05.24
+
|| 06:23
||'''" Does not satisfy triangle's inequality "''' is displayed on the canvas.
+
|'''Compiler''' cannnot find these '''errors'''.
  
 
|-
 
|-
||05.30
+
|| 06:27
||Let's now clear this program. Let me type '''clear''' command and run '''clear''' command cleans the canvas .
+
|For example:
 +
|-
 +
|| 06:29
 +
|Trying to divide by a '''variable''' that contains no value.
  
 
|-
 
|-
||   05.40
+
|| 06:3
|| let's next work with  '''not'' condition.
+
| Run a loop without a '''terminating condition''' or '''increment value'''.
 
|-
 
|-
||05.43
+
||06:43
||Let me copy the program from the text editor and paste it into  '''KTurtle''' editor.  
+
||I will clear the current program from the editor.
  
 
|-
 
|-
||05.51
+
|| 06:47
||Please pause the tutorial here and type the program into your KTurtle editor.  
+
|Type '''clear''' command and '''Run''' to clean the canvas.
 +
|-
 +
|| 06:52
 +
||I already have a program in a text editor.  
  
 
|-
 
|-
||05.56
+
|| 06:56
||Resume the tutorial after typing  the program.
+
|This program '''divides''' two numbers.
 +
 
 
|-
 
|-
||06.01
+
|| 07:00
||Let me zoom into the program text and explain the program.
+
|'a' is''' dividend''' and 'r' is '''divisor'''.  
 
|-
 
|-
||06.05
+
||07:04 
||'''reset''' command sets '''Turtle''' to '''default''' position.
+
||I will copy the program from text editor and paste it into '''KTurtle's''' Editor.  
 +
 
 
|-
 
|-
||06.09
+
|| 07:11
||'''$a, $b''' and '''$c''' are variables that  store user input.
+
|Pause the tutorial and type the program into your '''KTurtle''' editor
 +
 
 
|-
 
|-
||06.15
+
|| 07:16
||'''if not (($a==$b) and ($b==$c) and ($c==$a))'''checks the ''if not '' condition.
+
|Resume the tutorial after typing the program.  
 +
|-
 +
|| 07:20
 +
||Let us click on  '''Run''' button to run the program.  
  
 
|-
 
|-
||06.27
+
|| 07:24
||'''not''' is a special question glue-word. It inverses the logical state of its operand.
+
|let's enter '''5''' for 'a' and click OK
  
 
|-
 
|-
||06.36
+
|| 07:29
||e.g. If the given condition is true, not makes it false.
+
|enter '''0''' for 'r' and click OK
  
 
|-
 
|-
||06.42
+
|| 07:33
||And when the condition is false the output will be true.
+
|Here we get a ''' runtime error''' ,
 +
 
 
|-
 
|-
||06.48
+
|| 07:36
||'''print''' command displays the string after checking the '''if not''' condition.
+
|'''you tried to divide by zero'''
 
|-
 
|-
||06.55
+
|| 07:39
||'''else''' command is executed when '''if''' condition is false.
+
||This error is in line number 4.
 
|-
 
|-
||07.01
+
|| 07:43
||'''print''' command displays the string after checking the '''else''' condition.
+
||This error occurs as we cannot '''divide''' a number with''' zero'''.
 
|-
 
|-
||07.07
+
|| 07:49
||'''go 100,100''' commands ''' Turtle''' to go 100 pixels from left of canvas and 100 pixels from top of canvas
+
||Let us run  again.
 +
 
 
|-
 
|-
||07.20
+
|| 07:51
||'''repeat 3{turnright 120 forward 100}''' commands turtle to draws an equilateral triangle on the canvas
+
|Enter '''5''' for '''a''' and click OK
  
 
|-
 
|-
||07.32
+
|| 07:54
||Let me run the program to check all the conditions.
+
|enter '''2''' for 'r' and click OK
 +
 
 
|-
 
|-
||07.36
+
|| 07:58
||Press F5 key to run the code.
+
|Program without errors.
 +
|-
 +
|| 08:01
 +
||I will clear the current program from '''KTurtle''' editor.
  
 
|-
 
|-
|| 07.40
+
|| 08:05
||Enter  6 for length of AB and click OK
+
|Type '''clear''' command and '''Run''' to clean the canvas.
 +
|-
 +
||08:10
 +
||Next we will learn about ''' logical errors'''.
 +
|-
 +
|| 08:14
 +
||'''Logical error''' is a mistake in a program's '''source code''' that results in '''incorrect''' or '''unexpected''' behavior.
  
 
|-
 
|-
||07.45
+
|| 08:26
||Enter 5  for length of  BC  and click OK
+
|For example,
  
 
|-
 
|-
||07.48
+
|| 08:28
||Enter 7  for length of AC and click OK
+
|'''Assigning''' a value to the wrong variable.
  
 
|-
 
|-
||07.54
+
|| 08:32
||'''“Triangle is not equilateral”''' is displayed on the canvas.
+
|'''Multiplying''' two numbers instead of '''adding'''.
 +
|-
 +
||08:36
 +
||I already have a program in a text editor.
 +
|-
 +
||  08:39
 +
||I will copy the program from text editor and paste it into '''Kturtle's''' Editor
  
 
|-
 
|-
||07.58
+
|| 08:47
||Let's run again. Let's enter 5 for length of AB and click ok.
+
|Pause the tutorial here and type the program into your '''KTurtle''' editor
  
 
|-
 
|-
||08.05
+
|| 08:52
||5 for length of BC and click ok.
+
|Resume the tutorial after typing the program.  
 +
|-
 +
|| 08:57
 +
||Now click on the '''Run''' button to run the program.  
  
 
|-
 
|-
||08.09
+
|| 09:01
||5 for length of AC and click OK
+
||A dialog box pops-up, let's click OK.
  
 
|-
 
|-
||08.13
+
|| 09:05
||'''“Triangle is equilateral”''' is displayed on the canvas. An equilateral triangle is drawn on the canvas.
+
||Loop goes into an '''infinite loop'''.  
 
|-
 
|-
||08.21
+
|| 09:08
||With this we come to the end of this tutorial.
+
||We see that '''“while”''' loop prints numbers from 31 and  is still printing.
  
 
|-
 
|-
||08.25
+
|| 09:15
||Let's summarize
+
||This is a '''logical error'''.
  
 
|-
 
|-
||08.28
+
|| 09:18
||In this tutorial we have learnt, the question glues and  not
+
||In the “while” condition x is greater than 20,
 +
 
 
|-
 
|-
||08.35
+
|| 09:23
||As an assignment, I would like you to write program to determine
+
||but the '''variable''' x is always greater than 20
  
 
|-
 
|-
||08.40
+
|| 09:28
||Angle concept for  right angled triangle using question glue '''“or”'''
+
||So, the loop never '''terminates.'''
 +
|-
 +
|| 09:31
 +
||I will click on '''Abort''' button to abort the process.
 
|-
 
|-
||08.48
+
|| 09:36
||Structure of ''if or  ''condition is:
+
||Let's change $x=$x+1 to $x=$x-1.
 
+
 
|-
 
|-
||08.51
+
||09:44
||if within brackets '''condition''' '''or''' within brackets '''condition''' '''or''' within brackets '''condition.'''
+
|| I will copy the program from text editor and paste it into '''KTurtle's''' editor.
 +
|-
 +
|| 09:51
 +
||Let's click on '''Run''' button to run the program.  
  
 
|-
 
|-
||08.59
+
|| 09:55
||Within curly brackets '''do something.'''
+
||A dialog box pop-up. Let us click OK.
  
 
|-
 
|-
||09.02
+
|| 09:59
||'''else''' within curly brackets '''do something.'''
+
||Loop '''terminates''' after printing the values from''' 29 to 20.'''  
 
|-
 
|-
||09.06
+
||10:05
||Watch the video available at this URLhttp://spoken-tutorial.org/What is a Spoken Tutorial
+
||With this we  come to the end of this tutorial.
  
 
|-
 
|-
||09.10
+
|| 10:10
||It summarises the Spoken Tutorial project
+
||Let us summarise.
 
+
 
|-
 
|-
||09.13
+
|| 10:12
||If you do not have good bandwidth, you can download and watch it
+
||In this tutorial we have learnt, errors and types of errors such as
 +
 
 
|-
 
|-
||09.18
+
|| 10:18
||The Spoken Tutorial Project Team :
+
| Use of '''variable''' that has not been declared.
  
 
|-
 
|-
||09.20
+
|| 10:23
||Conducts workshops using spoken tutorials
+
|Missing '''quotes''' in strings.
  
 
|-
 
|-
||09.23
+
|| 10:27
||Gives certificates to those who pass an online test
+
|''' Runtime errors''' and
  
 
|-
 
|-
||09.27
+
|| 10:30
||For more details, please write to contact@spoken-tutorial.org
+
|| '''Logical errors'''
 
|-
 
|-
||09.34
+
|| 10:3
||Spoken Tutorial Project is a part of the Talk to a Teacher project.
+
||As an assignment I would like you to find errors in the given programs
 +
   
 +
|-
 +
||10:46
 +
||Watch the video available at this URl: http://spoken-tutorial.org/What is a Spoken Tutorial
 +
|-
 +
|| 10:50
 +
|It summarises the Spoken Tutorial project  
 +
|-
 +
|| 10:54
 +
|If you do not have good bandwidth, you can download and watch it
 +
|-
 +
||10:59
 +
||The Spoken Tutorial Project Team :
  
 
|-
 
|-
||09.38
+
|| 11:01
||It is supported by the National Mission on Education through ICT, MHRD, Government of India
+
|Conducts workshops using spoken tutorials
 +
|-
 +
|| 11:05
 +
|Gives certificates to those who pass an online test
 +
|-
 +
|| 11:09
 +
|For more details, please write to contact@spoken-tutorial.org
 +
|-
 +
|| 11: 17
 +
||Spoken Tutorial Project is a part  of the Talk to a Teacher project
  
 
|-
 
|-
||09.44
+
|| 11:23
 +
|It is supported by the National Mission on Education through ICT, MHRD, Government of India
 +
 +
|-
 +
||11:31
 
||More information on this Mission is available at this link http://spoken-tutorial.org/NMEICT-Intro ]
 
||More information on this Mission is available at this link http://spoken-tutorial.org/NMEICT-Intro ]
  
 
|-
 
|-
||09.49
+
||11:37
||This is Madhuri Ganpathi from IIT Bombay signing off.  
+
||This is Madhuri Ganpathi from IIT Bombay.Signing off
 
+
|-
 +
||11:41
 +
||Thank you  for joining
 +
|-
 +
|-
 +
||
 +
|This is Madhuri Ganpathi from IIT Bombay signing off.
 
Thank you  for joining
 
Thank you  for joining
 
|-
 
|-

Revision as of 10:56, 1 August 2013

Visual Cue Narration
00:01 Welcome to this tutorial on Common Errors in KTurtle.
00:07 In this tutorial, we will learn about
00:10 Syntax errors
00:12 Runtime errors and
00:14 Logical errors
00:17 To record this tutorial I am using,
00:20 Ubuntu Linux OS version 12.04.
00:25 KTurtle version. 0.8.1 beta.
00:31 We assume that you have basic working knowledge of KTurtle
00:36 If not, for relevant tutorials, please visit our website.

http://spoken-tutorial.org

00:42 Let's first define, What is an error ?
00:46 Error is a mistake in a program that produces an incorrect or unexpected result.
00:55 First I will explain about "Types of errors".
01:00 Syntax error is a violation of grammatical rules, of a programming language.
01:09 Compilation fails when a program has syntax errors.
01:15 Syntax errors are easy to find and fix.
01:22 For Example:
01:23 Unmatched parentheses, square and curly braces.
01:29 Use of variable that has not been declared.
01:34 Missing quotes in strings.
01:38 Let's open a new KTurtle Application.
01:42 Click on Dash home. In the Search bar, type KTurtle.
01:48 Click on the KTurtle icon.
01:51 Let's begin the tutorial with some types of syntax errors.
01:58 I already have a program in a text editor.
02:02 To explain the error in the program, I will comment part of the code.
02:09 Here, I will comment the line
02:11 $a=ask within double quotes "enter any number and click Ok"
02:19 I will use hash(#) sign to comment the line.
02:23 I will copy the program from text editor and paste it into Kturtle's Editor.
02:31 Pause the tutorial here and type the program into your KTurtle editor
02:37 Resume the tutorial after typing the program.
02:42 Let's click on Run button to run the program
02:47 Complier shows the following error,
02:50 variable "$a" was used without first being assigned to a value.
02:57 Here the error is in line number 4.
03:02 This is a syntax error. It occured, as the variable 'a' was not declared.
03:10 So I will go to line number 2, remove the comment.
03:14 I will copy the program from text Editor and paste it into KTurtle's editor.
03:23 Let's click on Run button to run the program
03:27 Enter 6 for a value and click OK
03:31 Program runs without errors.
03:35 I will clear the current program from KTurtle editor.
03:38 Type clear command and Run to clean the canvas.
03:43 let's next look at another error.
03:46 I already have a program in a text editor.
03:50 Here the value of "pi" is predefined in KTurtle.
03:54 Let's delete the "$" sign in the program.
03:58 I will copy the program from text editor and paste it into Kturtle's Editor
04:05 Pause the tutorial here and type the program into your KTurtle editor


04:11 Resume the tutorial after typing the program.
04:16 Let's Click on Run button to run the program.
04:19 Complier shows the following error,
04:22 you cannot put “=” here
04:26 This error is in line number 2.
04:30 This is a syntax error it occured, as there is no container of variable.
04:37 Let's go back to the program replace the $ sign.
04:41 I will copy the program from text editor and paste it into KTurtle's Editor
04:49 let's click on Run button to run the program.
04:53 Enter 45 for angle value and click OK
04:57 Program runs without errors.
05:00 Let's remove one of the quotes of the string.
05:05 I will Copy the program from text editor and paste it into KTurtle's Editor
05:12 Click on Run button to run the program
05:15 Complier shows the following error,
05:18 Text string was not properly closed, expected a double quote “ ” to close the string.
05:25 Here the error is in line number 2.
05:29 I will go back to line number 2 and replace the quotes.
05:34 I will copy the program from text editor and paste it into Kturtle's Editor
05:41 Click on Run button to run the program
05:44 Enter 45 for angle value and click OK.
05:49 Program runs without errors.
05:52 This way you can find the line at which error has occured, and also correct it.
05:59 Let's now learn about runtime errors.
06:04 Run-time error occurs during the execution of a program.
06:10 It may crash the program when you run it.
06:15 Runtime errors are commonly due to wrong input from the user.
06:23 Compiler cannnot find these errors.
06:27 For example:
06:29 Trying to divide by a variable that contains no value.
06:3 Run a loop without a terminating condition or increment value.
06:43 I will clear the current program from the editor.
06:47 Type clear command and Run to clean the canvas.
06:52 I already have a program in a text editor.
06:56 This program divides two numbers.
07:00 'a' is dividend and 'r' is divisor.
07:04 I will copy the program from text editor and paste it into KTurtle's Editor.
07:11 Pause the tutorial and type the program into your KTurtle editor
07:16 Resume the tutorial after typing the program.
07:20 Let us click on Run button to run the program.
07:24 let's enter 5 for 'a' and click OK
07:29 enter 0 for 'r' and click OK
07:33 Here we get a runtime error ,
07:36 you tried to divide by zero
07:39 This error is in line number 4.
07:43 This error occurs as we cannot divide a number with zero.
07:49 Let us run again.
07:51 Enter 5 for a and click OK
07:54 enter 2 for 'r' and click OK
07:58 Program without errors.
08:01 I will clear the current program from KTurtle editor.
08:05 Type clear command and Run to clean the canvas.
08:10 Next we will learn about logical errors.
08:14 Logical error is a mistake in a program's source code that results in incorrect or unexpected behavior.
08:26 For example,
08:28 Assigning a value to the wrong variable.
08:32 Multiplying two numbers instead of adding.
08:36 I already have a program in a text editor.
08:39 I will copy the program from text editor and paste it into Kturtle's Editor
08:47 Pause the tutorial here and type the program into your KTurtle editor
08:52 Resume the tutorial after typing the program.
08:57 Now click on the Run button to run the program.
09:01 A dialog box pops-up, let's click OK.
09:05 Loop goes into an infinite loop.
09:08 We see that “while” loop prints numbers from 31 and is still printing.
09:15 This is a logical error.
09:18 In the “while” condition x is greater than 20,
09:23 but the variable x is always greater than 20
09:28 So, the loop never terminates.
09:31 I will click on Abort button to abort the process.
09:36 Let's change $x=$x+1 to $x=$x-1.
09:44 I will copy the program from text editor and paste it into KTurtle's editor.
09:51 Let's click on Run button to run the program.
09:55 A dialog box pop-up. Let us click OK.
09:59 Loop terminates after printing the values from 29 to 20.
10:05 With this we come to the end of this tutorial.
10:10 Let us summarise.
10:12 In this tutorial we have learnt, errors and types of errors such as
10:18 Use of variable that has not been declared.
10:23 Missing quotes in strings.
10:27 Runtime errors and
10:30 Logical errors
10:3 As an assignment I would like you to find errors in the given programs
10:46 Watch the video available at this URl: http://spoken-tutorial.org/What is a Spoken Tutorial
10:50 It summarises the Spoken Tutorial project
10:54 If you do not have good bandwidth, you can download and watch it
10:59 The Spoken Tutorial Project Team :
11:01 Conducts workshops using spoken tutorials
11:05 Gives certificates to those who pass an online test
11:09 For more details, please write to contact@spoken-tutorial.org
11: 17 Spoken Tutorial Project is a part of the Talk to a Teacher project
11:23 It is supported by the National Mission on Education through ICT, MHRD, Government of India
11:31 More information on this Mission is available at this link http://spoken-tutorial.org/NMEICT-Intro ]
11:37 This is Madhuri Ganpathi from IIT Bombay.Signing off
11:41 Thank you for joining
This is Madhuri Ganpathi from IIT Bombay signing off.

Thank you for joining