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

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

Latest revision as of 18:39, 24 March 2017

Time 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 Run time 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:,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 Compiler 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 occurred 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 occurred 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 occurred and also correct it.
05:59 Let's now learn about run time 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 cannot find these errors.
06:27 For example:
06:29 Trying to divide by a variable that contains no value.
06:31 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 here 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 run time 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 runs 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 a 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 pops 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 summarize.
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.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 summarizes 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 :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.