Check out FilesAndExceptions from SVN. Exam 2 Review File I/O, Exceptions Vector Graphics Project

Similar documents
CSSE 220 Day 19. Object-Oriented Design Files & Exceptions. Check out FilesAndExceptions from SVN

CSSE 220 Day 19. Object-Oriented Design Files & Exceptions. Check out FilesAndExceptions from SVN

Administration. Exceptions. Leftovers. Agenda. When Things Go Wrong. Handling Errors. CS 99 Summer 2000 Michael Clarkson Lecture 11

Exceptions. Examples of code which shows the syntax and all that

Exceptions in Java

Lecture 20. Java Exceptional Event Handling. Dr. Martin O Connor CA166

CS 61B Data Structures and Programming Methodology. July 7, 2008 David Sun

Errors and Exceptions

ECE 122. Engineering Problem Solving with Java

Object oriented programming. Instructor: Masoud Asghari Web page: Ch: 7

Exceptions. Errors and Exceptions. Dealing with exceptions. What to do about errors and exceptions

Lecture 14: Exceptions 10:00 AM, Feb 26, 2018

Binary Tree Iterators and Properties Displayable Binary Trees

Abstract Classes, Exceptions

Internal Classes and Exceptions

COMP 213. Advanced Object-oriented Programming. Lecture 17. Exceptions

CSC207H: Software Design. Exceptions. CSC207 Winter 2018

Chapter 13 Exception Handling

Lecture 19 Programming Exceptions CSE11 Fall 2013

Announcements. 1. Forms to return today after class:

Day 8. COMP1006/1406 Summer M. Jason Hinek Carleton University

Le L c e t c ur u e e 5 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Exception Handling

Principles of Software Construction: Objects, Design and Concurrency. Exceptions, scope, static data and methods, and Generics.

Exceptions and Libraries

Exceptions vs. Errors Exceptions vs. RuntimeExceptions try...catch...finally throw and throws

Exception Handling. Sometimes when the computer tries to execute a statement something goes wrong:

Exception Handling. Run-time Errors. Methods Failure. Sometimes when the computer tries to execute a statement something goes wrong:

BBM 102 Introduction to Programming II Spring 2017

Programming Languages and Techniques (CIS120)

16-Dec-10. Consider the following method:

Defensive Programming. Ric Glassey

Exceptions. CSC207 Winter 2017

Java Loose Ends. 11 December 2017 OSU CSE 1

Java. Error, Exception, and Event Handling. Error, exception and event handling. Error and exception handling in Java

BBM 102 Introduction to Programming II Spring Exceptions

Lecture 14 Summary 3/9/2009. By the end of this lecture, you will be able to differentiate between errors, exceptions, and runtime exceptions.

Exceptions. Produced by. Algorithms. Eamonn de Leastar Department of Computing, Maths & Physics Waterford Institute of Technology

Exceptions. When do we need exception mechanism? When and why use exceptions? The purpose of exceptions

COMP200 EXCEPTIONS. OOP using Java, based on slides by Shayan Javed

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently.

PIC 20A Exceptions. Ernest Ryu UCLA Mathematics. Last edited: November 27, 2017

CS S-22 Exceptions 1. Running a web server, don t want one piece of bad data to bring the whole thing down

Exception Handling. General idea Checked vs. unchecked exceptions Semantics of... Example from text: DataAnalyzer.

Program Correctness and Efficiency. Chapter 2

Exception-Handling Overview

Introduction to Computer Science II CS S-22 Exceptions

Exceptions. Produced by. Introduction to the Java Programming Language. Eamonn de Leastar

CSC System Development with Java. Exception Handling. Department of Statistics and Computer Science. Budditha Hettige

Principles of Software Construction: Objects, Design, and Concurrency. Objects (continued) toad. Spring J Aldrich and W Scherlis

Main concepts to be covered. Handling errors. Some causes of error situations. Not always programmer error. Defensive programming.

Reminder. Topics CSE What Are Exceptions?! Lecture 11 Exception Handling

Project. C++: Inheritance III. Plan. Project. Before we begin. The final exam. Advanced Topics. Project. This week in the home stretch

Programming II (CS300)

Exception handling & logging Best Practices. Angelin

Lab 2: File Input and Output

Introduction to Programming System Design CSCI 455x (4 Units)

Tips from the experts: How to waste a lot of time on this assignment

Data Structures. 02 Exception Handling

Mathematics/Science Department Kirkwood Community College. Course Syllabus. Computer Science CSC142 1/10

Programming II (CS300)

Introduction to Data Structures

CSC 443: Web Programming

2.6 Error, exception and event handling

Intro to Computer Science II. Exceptions

Object-Oriented Programming Design Topic : Exception Programming

Exceptions and Design

ASSIGNMENT 5 Objects, Files, and a Music Player

CS 11 java track: lecture 3

Advanced Programming Concepts. CIS 15 : Spring 2007

Pages and 68 in [JN] conventions for using exceptions in Java. Chapter 8 in [EJ] guidelines for more effective use of exceptions.

CSCB58 - Lab 0. Intro to The Lab & The DE2 Board. Prelab /4 Part I (in-lab) /1 Part II (in-lab) /1

Assertions and Exceptions Lecture 11 Fall 2005

CS Introduction to Data Structures Tuesday, February 2, 2016

Name: Checked: Preparation: Write the output of DeckOfCards.java to a text file Submit through Blackboard by 8:00am the morning of Lab.

Review! * follows a pointer to its value! & gets the address of a variable! Pearce, Summer 2010 UCB! ! int x = 1000; Pearce, Summer 2010 UCB!

Introduction Unit 4: Input, output and exceptions

EXCEPTION HANDLING. Summer 2018

PRINCIPLES OF SOFTWARE BIM209DESIGN AND DEVELOPMENT 00. WELCOME TO OBJECTVILLE. Speaking the Language of OO

Administrivia. CPSC Winter 2008 Term 1. Department of Computer Science Undergraduate Events

COS226 - Spring 2018 Class Meeting # 21 April 23, 2018

Java Programming Unit 7. Error Handling. Excep8ons.

CMSC131. Exceptions and Exception Handling. When things go "wrong" in a program, what should happen.

ASSIGNMENT 5 Data Structures, Files, Exceptions, and To-Do Lists

Exceptions and Error Handling

Exceptions - Example. Exceptions - Example

CS112 Lecture: Exceptions and Assertions

Defensive Programming

More on Objects in JAVA TM

Programming for Mobile Computing

CS11 Java. Fall Lecture 4

CS61BL. Lecture 1: Welcome to CS61BL! Intro to Java and OOP Testing Error-handling

Throughout the exam, write concisely and underline key words or phrases. Have fun! Exam 2. Week 7 (Winter 2013). Dr. Yoder. Sec 031.

COMP1008 Exceptions. Runtime Error

CS 112 Programming 2. Lecture 08. Exception Handling & Text I/O (1) Chapter 12 Exception Handling and Text IO

Writing your own Exceptions. How to extend Exception

Comp 249 Programming Methodology Chapter 9 Exception Handling

JAC444 - Lecture 4. Segment 1 - Exception. Jordan Anastasiade Java Programming Language Course

More on Exception Handling

A problem?... Exceptions. A problem?... A problem?... Suggested Reading: Bruce Eckel, Thinking in Java (Fourth Edition) Error Handling with Exceptions

About This Lecture. Outline. Handling Unusual Situations. Reacting to errors. Exceptions

Transcription:

Check out FilesAndExceptions from SVN Exam 2 Review File I/O, Exceptions Vector Graphics Project

Exam 2 review File I/O and Exceptions Vector Graphics project kickoff

Exam is in class tomorrow

Test on Tuesday In-class exam Meet in your usual room at time indicated on the schedule Topics from Chapters 1-14 Will include: An open computer exam with: A paper part: short answer, fill-in-the-blank, trace-code-by-hand, draw box-and-pointer diagrams, find-errors-in-code, write short chunks of code, etc A programming part: a few small programs, unit tests provided for some of them, you write unit tests for others Review in class today What questions did you bring? What topics would you like to review? I didn t prepare anything but I m happy to cover whatever you want, including working examples

Reviewed chapters 1 to 14 from Big Java Prepared a sheet of notes to help you summarize what you consider important Reviewed the slides, in-class quizzes, homework from sessions 1 to 21 Practiced programming, unit testing, documenting your code, & using the Java API You can ask questions by email to the csse220-staff mailing list or your instructor

Reading & writing files When the unexpected happens

Look at GameOfLifeWithIO GameOfLife constructor has 2 listeners, one local inner class and one local anonymous class ButtonPanel constructor has 3 listeners which are local anonymous classes Feel free to use as examples for your project

Input: File and Scanner Output: PrintWriter and println Be kind to your OS: close() all files Letting users choose: JFileChooser and File Expect the unexpected: Exception handling Refer to examples when you need to Q1-Q4

Used to signal that something went wrong: throw new EOFException( Missing column ); Can be caught by exception handler Recovers from error Or exits gracefully Q5

Java has two sorts of exceptions Checked exceptions: compiler checks that calling code isn t ignoring the problem Used for expected problems Unchecked exceptions: compiler lets us ignore these if we want Used for fatal or avoidable problems Are subclasses of RunTimeException or Error Q6-Q7

Dealing with checked exceptions Can propagate the exception Just declare that our method will pass any exceptions along public void loadgamestate() throws IOException Used when our code isn t able to rectify the problem Can handle the exception Used when our code can rectify the problem Q8

Use try-catch statement: try { // potentially exceptional code } catch (ExceptionType var) { // handle exception } Related, try-finally for clean up: try { // code that requires clean up } finally { // runs even if exception occurred } Can repeat this part for as many different exception types as you need. Q9-Q10

A team project to create a scalable graphics program.

11,addantnb,filhobc,taos,wilsonam 12,caijy,chena1,lyonska,spurrme 13,hopwoocp,luok,nelsonca,shanx 14,cornetcl,eckertzs,elswicwj,hirtjd Team number used in repository name: http://svn.csse.rose-hulman.edu/repos/csse220-201130-vg-teamxx Check out VectorGraphics from SVN

21,finnelhn,haydr,lawrener 22,oliverr,senatwj,myersem,rybickcb 23,cooperdl,fengk,amesen 24,solorzaa,whitemrj,hazelrtj,zhenw 25,mehrinla,tilleraj,vassardm Team number used in repository name: http://svn.csse.rose-hulman.edu/repos/csse220-201130-vg-teamxx Check out VectorGraphics from SVN

A team assignment So some division of labor is appropriate (indeed, necessary) A learning experience, so: Rule 1: every team member must participate in every major activity. Rule 2: Everything that you submit for this project should be understood by all team members. Not necessarily all the details, but all the basic ideas

Read the specification Exchange contact info you may want to add to your planning folder. Start working on your milestone 0 due tomorrow Try to get it done in class today so you can: Get some feedback in class before it s graded. Focus on studying for the exam tonight.

If you complete these, show me: CRC cards UML as complete as you can will help coding later. User stories for cycle 1 Ask questions as needed! Work on the rest, cycle one due Thursday. There s a quick partner eval At end of project If you are done, you have my blessing to start coding cycle 1 Use any reasonable combination of: group meetings and/or dividing up the work