Can you pick 3 errors from this

Slides:



Advertisements
Similar presentations
Topics Introduction Types of Errors Exceptions Exception Handling
Advertisements

Introduction to Computing Using Python Exceptions (Oops! When things go wrong)  Errors and Exceptions  Syntax errors  State (execution) errors.
Programming Types of Testing.
Guidelines for working with Microsoft Visual Studio 6.
Activity 1 - WBs 5 mins Go online and spend a moment trying to find out the difference between: HIGH LEVEL programming languages and LOW LEVEL programming.
19/5/2015CS150 Introduction to Computer Science 1 Announcements  1st Assignment due next Monday, Sep 15, 2003  1st Exam next Friday, Sep 19, 2003  1st.
UNIT 3 TEMPLATE AND EXCEPTION HANDLING. Introduction  Program errors are also referred to as program bugs.  A C program may have one or more of four.
WEEK EXCEPTION HANDLING. Syntax Errors Syntax errors, also known as parsing errors, are perhaps the most common kind of complaint you get while.
Programming Translators.
Python Programming Using Variables and input. Objectives We’re learning to make use of if statements to enable code to ask questions. Outcomes Build an.
General Programming Introduction to Computing Science and Programming I.
Dealing with Errors. Error Types Syntax Errors Runtime Errors Logical Errors.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Cem Sahin CS  There are two distinguishable kinds of errors: Python's Errors Syntax ErrorsExceptions.
Basic Programming Lingo. A program is also known as a  Sequence of instructions  Application  App  Binary  Executable.
1 Program Planning and Design Important stages before actual program is written.
Introduction to Python Lesson 1 First Program. Learning Outcomes In this lesson the student will: 1.Learn some important facts about PC’s 2.Learn how.
Software Development. Software Development Loop Design  Programmers need a solid foundation before they start coding anything  Understand the task.
School of Computer Science & Information Technology G6DICP - Lecture 6 Errors, bugs and debugging.
ERRORS. Types of errors: Syntax errors Logical errors.
REVIEW No curveballs this time …. PROBLEM TYPE #1: EVALUATIONS.
5.01 Understand Different Types of Programming Errors
Introduction to Computing Using Python Exceptions (Oops! When things go wrong)  Errors and Exceptions  Syntax errors  State (execution) errors.
COMPUTER PROGRAMMING I SUMMER Understand Different Types of Programming Errors.
Introducing Python 3 Introduction to Python. Introduction to Python L1 Introducing Python 3 Learning Objectives Know what Python is and some of the applications.
Harvard Mark I Howard Aiken was a pioneer in computing and a creator of conceptual design for IBM in the 1940s. He envisioned an electro-mechanical computing.
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
MOOR ERROR HANDLING Types of error How to test your code for errors How to detect errors How to recover from errors.
Few More Math Operators
Introducing Python Introduction to Python.
Development Environment
Exceptions in Python Error Handling.
Component 1.6.
Software Development.
Introduction to Computing Science and Programming I
5.01 Understand Different Types of Programming Errors
ME 142 Engineering Computation I
Input and Output Upsorn Praphamontripong CS 1110
Data Types Variables are used in programs to store items of data e.g a name, a high score, an exam mark. The data stored in a variable is entered from.
CS170 – Week 1 Lecture 3: Foundation Ismail abumuhfouz.
Introduction to Python
7 - Programming 7P, Q, R - Testing.
SDC – SDLC integration.
Software Design and Development
2_Testing Testing techniques.
CSS 161: Fundamentals of Computing
Lesson Outcomes Be able to identify differentiate between types of error in programs Be able to interpret error messages and identify, locate.
TRANSLATORS AND IDEs Key Revision Points.
Cracking the Coding Interview
5.01 Understand Different Types of Programming Errors
Programming Fundamentals (750113) Ch1. Problem Solving
Detecting and Resolving Model Errors
ERRORS AND EXCEPTIONS Errors:
(Oops! When things go wrong)
Exceptions.
Programming.
Problems Debugging is fine and dandy, but remember we divided problems into compile-time problems and runtime problems? Debugging only copes with the former.
Python Syntax Errors and Exceptions
Lesson 2 Get Started with Python – Post-Installation – Use the GUI.
For loops Taken from notes by Dr. Neil Moore
By Ryan Christen Errors and Exceptions.
Software Development Environment, File Storage & Compiling
Learning Intention I will learn about the different types of programming errors.
Debugging and Handling Exceptions
Introduction to Python programming for KS3
Review of Previous Lesson
WJEC GCSE Computer Science
Starter Which of these inventions is: Used most by people in Britain
CHAPTER 6 Testing and Debugging.
Dealing with Runtime Errors
Presentation transcript:

Can you pick 3 errors from this Starter Can you pick 3 errors from this Temp = input("What is the temperature in the house?") if (int(Temp) <= 15): Print ("The temperature is ", Temp, "degrees. Time to put the heating on") else: print "The temperature is ", Temp, "degrees. The heating is going off"

Can you pick 3 errors from this Starter Can you pick 3 errors from this Temp = input("What is the temperature in the house?") if (int(Temp) <= 15): Print ("The temperature is ", Temp, "degrees. Time to put the heating on") else: print ("The temperature is ", Temp, "degrees. The heating is going off“) How tedious is that?

Lesson Outcomes 2.1.3 Be able to identify differentiate between types of error in programs 2.1.4 Be able to interpret error messages and identify, locate and fix errors in a program. 2.1.7 Be able to make effective use of tools offered in an integrated development environment [watcher, break points, single step, step throughs] What causes error messages All of should be able to recall different error types All of you should be able to recall error messages in python

Making errors... Making mistakes is okay. It happens all the time! But you don’t release a game with errors http://www.bbc.co.uk/news/technology-25137093 http://www.youtube.com/watch?v=9zjGgau3iF8&safe=active

Errors in programs and being able to handle them. There are basically 3 types Of error… Logic Syntax Runtime

Errors in programs and being able to handle them. An error in the design of the program, wrong programming or wrong logic. (May not produce an error – just wrong outcome) often no obvious error is flagged up Often due to mistake in the algorithm or wrong data type. Format errors failing to follow the grammar rules of the programming language used.

What errors? print hello world syntax

What errors? Name = 'Al' print(‘You can call me ' + name) Runtime error

What errors? spam = 'THIS IS IN LOWERCASE.' spam = spam.lowerr() Runtime error

What errors? x = 3 y = 4 average = x + y / 2 print(average) http://cscircles.cemc.uwaterloo.ca/1e-errors/

What errors? spam = ['cat', 'dog', 'mouse'] print(spam[6]) Runtime error

Errors in programs and being able to handle them. Type Error Runtime NameError ZeroDivisionError KeyBoardInterrupt When a name is used that is not known about (often a variable name that is misspelt). Dividing a number by zero. When a program is interrupted from the keyboard by pressing control+c. An error occurs when the program is running. When an operation is attempt that is invalid for that type of data. Specific to python

Odd task alert Go away and try to make mistakes: Make an example of: A runtime error A syntax error A logic error

Trace Table A technique used to test algorithms to see if any logic errors occur when the algorithm is processed.

Testing for errors before and during the coding stages

Testing for errors during the execution of code Breakpoints Steps Watches

Activity 4.1 and 4.2 4.3 4.4 4.5 and 4.6