The Problem You are writing a program that accepts from the command line a number and that number tells the application how many numbers to read from standard.

Slides:



Advertisements
Similar presentations
Chapter 15 Geography, Climate, and Natural Resources.
Advertisements

Chapter 2 Application Layer. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 2-2.
Chapter 13 Income Inequality. Copyright © 2005 Pearson Addison-Wesley. All rights reserved
Chapter 1 The Facts to Be Explained. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2.
Chapter 1 Computer Networks and the Internet. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2.
Chapter 3 Transport Layer. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 3-2.
Chapter 6 Human Capital. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 6-2.
Chapter 8 The Role of Technology in Growth. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 8-2.
Java How to Program, 9/e © Copyright by Pearson Education, Inc. All Rights Reserved.
Chapter 7 Multimedia Networking. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 7-2.
Chapter 16 Resources and the Environment at the Global Level.
Starting Out With Java 5 Control Structures to Objects By Tony Gaddis Copyright © 2005 Pearson Addison- Wesley. All rights reserved. Chapter 1 Slide #1.
Chapter 1 Functions Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Chapter 3 Derivatives Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Linear Programming: The Graphical Method
Chapter 3 Differentiation
© 2010 Pearson Education, Inc. All rights reserved
Chapter 9 Power Series Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Chapter 2 Limits Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Sequences and Infinite Series
Pay and Productivity: Wage Determination within the Firm
all loops initialization – set up the loop
Integration Techniques
Chapter 10 Exceptions.
Chapter 17 Linked Lists.
Chapter 19 Binary Search Trees.
11.7 Motion in Space Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Chapter 4 Inheritance.
Chapter 1 Preliminaries.
Chapter 7 Functions of Random Variables (Optional)
Further Applications of Integration
Chapter 11—Exceptions Handling Exceptions Throwing Exceptions.
© 2010 Pearson Education, Inc. All rights reserved
Chapter 14 Graphs and Paths.
Advanced Java Programming
Exception Handling: A Deeper Look
Classes and Objects housefly object Insect class mosquito object
Chapter 10 Datapath Subsystems.
Applications of the Derivative
Chapter 5 Integration Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
11.8 Length of Curves Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Chapter 18 Bayesian Statistics.
Chapter 20 Hash Tables.
Chapter 2 Limits and Continuity
Copyright © 2011 Pearson Education, Inc
Chapter 1 Preliminaries
Chapter 5 Some Discrete Probability Distributions.
Searching for Guinea Pig B: Case Study in Online Research
Chapter 12 Linear Regression and Correlation
Chapter 1 Functions Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Chapter 5 Algorithm Analysis.
Copyright © 2006 Pearson Education, Inc
Absolute Value Equations and Inequalities
The Facts to Be Explained
Copyright © 2006 Pearson Education, Inc
Alternate Proofs of Selected HO Theorems
POWER CHALLENGES Several Ways To Solve 7 CHALLENGES.
Introduction: Some Representative Problems
Chapter 10 Exceptions.
I/O Exceptions & Working with Files
Chapter 4 Mathematical Expectation.
Section 2.3 Introduction to File Input
2.3 The Composition of Functions
Circuit Characterization and Performance Estimation
The Classical Model with Many Goods
Chapter 2 Part 1 Data and Expressions.
Chapter 6 Dynamic Programming.
Chapter 2 Reference Types.
Chapter 4 Greedy Algorithms.
Copyright © 2011 Pearson Education, Inc
Presentation transcript:

The Problem You are writing a program that accepts from the command line a number and that number tells the application how many numbers to read from standard input. What are the different problems that can arise from such an application? Where can it go wrong? In your group, list the different problems that can occur in working with the above

Solutions So how do you solve each of these? OR …..? In your group, identify a way to solve each of the problems. OR …..?

Exception handling See html notes and book, chapter 12.1

Copyright © 2005, Pearson Addison-Wesley. All rights reserved. Exception Classes Object Throwable Exception Error RuntimeException IOException FileNotFoundException EOFException … Starting Out With Java Control Structures to Objects By Tony Gaddis Copyright © 2005, Pearson Addison-Wesley. All rights reserved.