IST256 : Applications Programming for Information Systems

Slides:



Advertisements
Similar presentations
Exception Handling Chapter 15 2 What You Will Learn Use try, throw, catch to watch for indicate exceptions handle How to process exceptions and failures.
Advertisements

Debugging Introduction to Computing Science and Programming I.
Chapter 8 Overview – Learn to use try catch blocks – Learn to use streams – Learn to use text files.
Exceptions 2 COMPSCI 105 S Principles of Computer Science.
CSc2310 tutoring session, week 8 Fall, 2012 Haidong Xue 5:30pm—8:30pm 10/23/2012 and 10/24/2012 -Using Exceptions -Homework 4.
CIT 590 Intro to Programming Lecture 3. Pair programming logistics You and your partner submit 1 assignment Figure out who the submitter will be PLEASE.
For loops in programming Assumes you have seen assignment statements and print statements.
Exceptions CMSC 201. Overview Exceptions are run-time errors, especially ones that the programmer cannot predict.  example 1: division by zero  example.
CS 127 Exceptions and Decision Structures. Exception Handling This concept was created to allow a programmer to write code that catches and deals with.
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
Exception Handling and String Manipulation. Exceptions An exception is an error that causes a program to halt while it’s running In other words, it something.
Python Exceptions and bug handling Peter Wad Sackett.
Head First Python: Ch 3. Files and Exceptions: Dealing with Errors Aug 26, 2013 Kyung-Bin Lim.
EXCEPTIONS. Catching exceptions Whenever a runtime error occurs, it create an exception object. The program stops running at this point and Python prints.
Exception testing Aistis Karkauskas, IFM-2/2. Introduction  Exceptions – anomalous or exceptional events requiring special processing – often changing.
PYTHON PROGRAMMING Year 9. Objective and Outcome Teaching Objective Today we will look at conditional statements in order to understand how programs can.
Lab 6 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.
Lesson 06: Functions Class Participation: Class Chat:
Lesson 03: Variables and Types
Teacher Contact Information address - Phone number – 215 – 944 – 1154 Website is always available for you.
C++ Exceptions.
Exceptions in Python Error Handling.
Introduction to Computing Science and Programming I
Generics, Exceptions and Undo Command
Lesson 08: Files Class Participation: Class Chat: Attendance Code 
Exceptions In this lecture:
Week of 12/12/16 Test Review.
Handling Exceptionally Sticky Problems
Exceptions and User Input Validation
Lesson 04: Conditionals Topic: Introduction to Programming, Zybook Ch 3, P4E Ch 3. Slides on website.
Active Learning Strategies For Your Classroom
IST256 : Applications Programming for Information Systems
IST256 : Applications Programming for Information Systems
Lesson 05: Iterations Class Chat: Attendance: Participation
IST256 : Applications Programming for Information Systems
Day 2 Lino Block Collect your mini-booklet at the door from last class
IST256 : Applications Programming for Information Systems
Algorithm and Ambiguity
Fall 2017 CISC124 9/21/2018 CISC124 First onQ quiz this week – write in lab. More details in last Wednesday’s lecture. Repeated: The quiz availability.
Exceptions C++ Interlude 3
Introduction to Programming
Python Lesson 3 Mr. Kalmes.
Exceptions with Functions
Lesson 04: Conditionals Class Chat: Attendance: Participation
Lesson 05: Iterations Topic: Introduction to Programming, Zybook Ch 4, P4E Ch 5. Slides on website.
Validations and Error Handling
Exception Handling.
Exception Handling and Reading / Writing Files
Exceptions CSCE 121 J. Michael Moore
IST256 : Applications Programming for Information Systems
ERRORS AND EXCEPTIONS Errors:
(Oops! When things go wrong)
Lesson 03: Variables and Types
Lesson 08: Files Class Chat: Attendance: Participation
Python programming exercise
15-110: Principles of Computing
Advanced Python Concepts: Exceptions
CISC101 Reminders Assignment 3 due next Friday. Winter 2019
SEMI Journal 5/29/18 Start a new set of journals.
Advanced Python Concepts: Exceptions
Announcements Quiz 5: grades and solution posted
Handling Exceptionally Sticky Problems
Bell-ringer: 5 minutes Copy CCSS/Objectives/HW
Bell-ringer: 5 minutes How could you verify your experiment results and conclusions? [Explain at least 2-3 ways.] Why is it important that you do so? Copy.
CMSC 202 Exceptions 2nd Lecture.
IST256 : Applications Programming for Information Systems
Python Exceptions and bug handling
Lab 1 Exception Handling.
IST256 : Applications Programming for Information Systems
Dealing with Runtime Errors
Presentation transcript:

IST256 : Applications Programming for Information Systems Exceptions

Agenda Connection Activity Teaching: Practice Activity Quiz, Homework Check Teaching: Exceptions Practice Activity Quiz Average

Quiz #3, HW Check Connect Activity After you turn in the quiz, Open Twitter Sentiment 1.0 For a Homework Check

Exceptions are… Exceptional Exceptions represent a class of errors which occur at run-time. We’ve seen these before when run a program and it crashes due to bad input. And we get a TypeError or ValueError. Python provides a mechanism try .. except to catch these errors at run-time and prevent your program from crashing. Exceptions are exceptional. They should ONLY be used to handle unforeseen errors in program input.

Watch Me Code The need for an exception handling: Bad input Good practice of catching the specific error

Try…Except…Finally try: statements-which-might throw-a-runtime-error except exceptionType: code-to-run-when-error-occurs finally: code-to-run-after-try-or-except Optional

Check Yourself: 90 Second Challenge Input: “dc” X ? Y ? Z? Input “4” X? Y? Z?

Help me Code Old Enough to Vote, Exception Style Let’s Revisit our Program which tells you if you’re old enough to vote given you age, but now uses exceptions to handle non-integer input.

Now You Code Quiz Average Write a program to read a series of quiz grades until you enter “quit” (or “Quit”, or “QUIT” – should not mater) After you enter “quit” it should print out the number of quizzes and the average quiz grade. When you enter something that is not a number, the program should say “Invalid quiz grade – please try again” BONUS: When you enter quiz grade not between 0 and 100 it should say “Invalid quiz grade – please try again”

Conclusion Activity NO CONCLUSION ACTIVITY THIS WEEK Your “Ticket Out” Take out a piece of paper. Print your name at the top Write down ONE THING on the paper you learned today. My TA’s will collect your paper on the way out. The activity will be effort graded.