© Copyright 1992-2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Enhanced Inventory Application.

Slides:



Advertisements
Similar presentations
Basic Java – Interface design. Understand: How to use TextPad for Java How to define classes and objects How to create a GUI interface How event-driven.
Advertisements

Introduction to Java Classes, events, GUI’s. Understand: How to use TextPad How to define a class or object How to create a GUI interface How event-driven.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 15 – Exception Handling Outline 15.1 Introduction 15.2 Exception-Handling Overview 15.3 Exception-Handling.
 2002 Prentice Hall, Inc. All rights reserved. Chapter 14 – Exception Handling Outline 14.1 Introduction 14.2 When Exception Handling Should Be Used 14.3.
Lecture 2 Introduction to C Programming
Introduction to C Programming
 2005 Pearson Education, Inc. All rights reserved Introduction.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 15.1 Test-Driving the Craps Game Application.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 14.1 Test-Driving the Fund Raiser Application.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 4 – Introducing Algorithms, Pseudocode and.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Objectives –Display a date and time. –Use a JPasswordField.
1 Class 8. 2 Chapter Objectives Use Swing components to build the GUI for a Swing program Implement an ActionListener to handle events Add interface components.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 6.1 Test-Driving the Wage Calculator Application.
Chapter 6: Graphical User Interface (GUI) and Object-Oriented Design (OOD) J ava P rogramming: Program Design Including Data Structures Program Design.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 16.1 Test-Driving the Flag Quiz Application.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - Welcome Application: Introduction to C++
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - HelloWorld Application: Introduction to.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 8 - Interest Calculator Application: Introducing.
Java Programming: From Problem Analysis to Program Design, Second Edition1  Learn about basic GUI components.  Explore how the GUI components JFrame,
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 20.1 Test-Driving the Screen Saver Application.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 7.1 Test-Driving the Wage Calculator Application.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 4 – Wage Calculator Application: Introducing.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 27 - Phone Book Application Introducing Multimedia.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 5 – Dental Payment Application: Introducing.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 9 – Income Tax Calculator Application: Introducing.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 18.1 Test-Driving the Microwave Oven Application.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 17 – Flag Quiz Application Introducing One-Dimensional.
 2000 Prentice Hall, Inc. All rights reserved. 1 Chapter 2 - Introduction to Java Applications Outline 2.1Introduction 2.2A Simple Program: Printing a.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 19.1 Test-Driving the Shipping Hub Application.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Security Panel Application Introducing the Select Case Multiple-Selection Statement.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 23.1 Test-Driving the Screen Scraping Application.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 25 – Ticket Information Application Introducing.
1 CSE1340 Class 4. 2 Objectives Write a simple computer program in Java Use Swing components to build the GUI Use proper naming conventions for classes.
1 Class 6. 2 Objectives Objectives Enable your applications to perform actions in response to JButton clicks Get the text the user enters in a textfield.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 22.1 Test-Driving the Typing Skills Developer.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 21.1 Test-Driving the Painter Application.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 12 – Enhancing the Wage Calculator Application.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
Java Programming: From Problem Analysis to Program Design, 3e Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 8.1 Test-Driving the Car Payment Calculator.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 11.1 Test-Driving the Security Panel Application.
Java Programming: From Problem Analysis to Program Design, Second Edition1 Lecture 5 Objectives  Learn about basic GUI components.  Explore how the GUI.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 3 – Inventory Application: Introducing Variables,
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 3 – Inventory Application: Introducing Variables,
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 10.1 Test-Driving the Interest Calculator.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 24.1 Test-Driving the Enhanced Car Payment.
Chapter 11 - A GUI Interacting With a Problem Domain Class1 Chapter 11 A GUI Interacting With a Problem Domain Class 11.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 13.1 Test-Driving the Enhanced Interest Calculator.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 2 – Welcome Application Introduction to Graphical.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 27.1 Test-Driving the Drawing Shapes Application.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 4 – Completing the Inventory Application.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 17.1 Test-Driving the Student Grades Application.
Swing GUI Components So far, we have written GUI applications which can ‘ draw ’. These applications are simple, yet typical of all Java GUI applications.
Lesson 28: More on the GUI button, frame and actions.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 28.1 Java Speech API 28.2 Downloading and.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 7.1 Test-Driving the Dental Payment Application.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 7 ( Book Chapter 14) GUI and Event-Driven Programming.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
Introduction Many Java application use a graphical user interface or GUI (pronounced “gooey”). A GUI is a graphical window or windows that provide interaction.
Chapter 14 – Exception Handling
Java Programming: From Problem Analysis to Program Design,
CiS 260: App Dev I Chapter 6: GUI and OOD.
Presentation transcript:

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Enhanced Inventory Application 5.2 Variables 5.3 Handling the keyPressed event for a JTextField 5.4 Memory Concepts 5.5 Arithmetic 5.6Using the Debugger: Breakpoints and the run, stop, cont and print Commands 5.7Internet and Web Resources 5.8Wrap-Up Tutorial 5 – Enhancing the Inventory Application Introducing Variables, Memory Concepts, Arithmetic and Keyboard Events

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 2 Objectives In this tutorial, you will learn to: –Declare variables. –Handle the keyPressed event for a JTextField. –Apply basic memory concepts using variables. –Use the precedence rules of arithmetic operators. –Set breakpoints to debug applications. –Use the debugger’s run, stop, cont and print commands.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Enhanced Inventory Application

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 4 Figure 5.1 Running the enhanced Inventory application. 5.1 Test-Driving the Enhanced Inventory Application (Cont.) Run the Inventory application – cd c:\Examples\Tutorial05\ CompletedApplication\Inventory3 – java Inventory

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Enhanced Inventory Application (Cont.) Figure 5.2 Calculating the number of items in the shipment. Enter 5 in Cartons per shipment: JTextField Enter 6 in Items per carton: JTextField Click Calculate Total JButton

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Enhanced Inventory Application (Cont.) Figure 5.3 Enhanced Inventory application clears output JTextField (to avoid confusion) after new input. Total is removed when JTextField is changed Cleared output JTextField

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Variables Figure 5.4 Declaring variables in event handler calculateJButtonActionPerformed. Variable declarations Variables – Storage location that holds data – Allows storage without a GUI component – Type – Initial value

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Variables (Cont.) Figure 5.5 Retrieving numerical input from JTextField s in event handler calculateJButtonActionPerformed. Assigning user input to variables Assignment operator – copies value on right side into variable on left side

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Variables (Cont.) Figure 5.6 Updated Inventory application. Save the changes to your code Compile and run in the Command Prompt

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Variables (Cont.) Type – specifies the type of data a variable stores – primitive type – specific type built in by Java – primitive type names are also keywords

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Variables (Cont.) Figure 5.8 Multiplying two variables in an assignment statement. Figure 5.9 Displaying the result of the calculation. Multiply cartons and items, then assign the result to the variable result Display result of calculation in totalResult JTextField

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Variables (Cont.) Figure 5.10 Displaying the multiplication result. Result of calculation

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Handling the keyPressed event for a JTextField Figure 5.11 keyPressed event handler for Cartons per shipment: JTextField. keyPressed event handler Clear totalResult JTextField keyPressed event – triggered when key is pressed in JTextField

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Handling the keyPressed event for a JTextField (Cont.) Figure 5.12 keyPressed event handler for Items per carton: JTextField. Clear totalResult JTextField empty string – string value containing no characters

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Handling the keyPressed event for a JTextField (Cont.) Figure 5.13 Testing the completed Inventory application. Output JTextField clears when value in either input JTextField is changed

 2004 Prentice Hall, Inc. All rights reserved. Outline 16 Inventory.java (1 of 8) 1 // Tutorial 5: Inventory.java 2 // Calculates the number of items in a shipment based on the number 3 // of cartons received and the number of items per carton. 4 import java.awt.*; 5 import java.awt.event.*; 6 import javax.swing.*; 7 8 public class Inventory extends JFrame 9 { 10 // JLabel and JTextField for cartons per shipment 11 private JLabel cartonsJLabel; 12 private JTextField cartonsJTextField; // JLabel and JTextField for items per carton 15 private JLabel itemsJLabel; 16 private JTextField itemsJTextField; // JLabel and JTextField for total items per shipment 19 private JLabel totalJLabel; 20 private JTextField totalResultJTextField; // JButton to initiate calculation of total items per shipment 23 private JButton calculateJButton; 24

 2004 Prentice Hall, Inc. All rights reserved. Outline 17 Inventory.java (2 of 8) 25 // no-argument constructor 26 public Inventory() 27 { 28 createUserInterface(); 29 } // create and position GUI components; register event handlers 32 public void createUserInterface() 33 { 34 // get content pane for attaching GUI components 35 Container contentPane = getContentPane(); // enable explicit positioning of GUI components 38 contentPane.setLayout( null ); // set up cartonsJLabel 41 cartonsJLabel = new JLabel(); 42 cartonsJLabel.setText( "Cartons per shipment:" ); 43 cartonsJLabel.setBounds( 16, 16, 130, 21 ); 44 contentPane.add( cartonsJLabel ); 45

 2004 Prentice Hall, Inc. All rights reserved. Outline 18 Inventory.java (3 of 8) 46 // set up cartonsJTextField 47 cartonsJTextField = new JTextField(); 48 cartonsJTextField.setText( "0" ); 49 cartonsJTextField.setBounds( 148, 16, 40, 21 ); 50 cartonsJTextField.setHorizontalAlignment( JTextField.RIGHT ); 51 contentPane.add( cartonsJTextField ); 52 cartonsJTextField.addKeyListener( new KeyAdapter() // anonymous inner class 55 { 56 // method called when user types in cartonsJTextField 57 public void keyPressed( KeyEvent event ) 58 { 59 cartonsJTextFieldKeyPressed( event ); 60 } } // end anonymous inner class ); // end call to addKeyListener // set up itemsJLabel 67 itemsJLabel = new JLabel(); 68 itemsJLabel.setText( "Items per carton:" ); 69 itemsJLabel.setBounds( 16, 48, 104, 21 ); 70 contentPane.add( itemsJLabel );

 2004 Prentice Hall, Inc. All rights reserved. Outline 19 Inventory.java (4 of 8) // set up itemsJTextField 73 itemsJTextField = new JTextField(); 74 itemsJTextField.setText( "0" ); 75 itemsJTextField.setBounds( 148, 48, 40, 21 ); 76 itemsJTextField.setHorizontalAlignment( JTextField.RIGHT ); 77 contentPane.add( itemsJTextField ); 78 itemsJTextField.addKeyListener( new KeyAdapter() // anonymous inner class 81 { 82 // method called when user types in itemsJTextField 83 public void keyPressed( KeyEvent event ) 84 { 85 itemsJTextFieldKeyPressed( event ); 86 } } // end anonymous inner class ); // end call to addKeyListener 91

 2004 Prentice Hall, Inc. All rights reserved. Outline 20 Inventory.java (5 of 8) 92 // set up totalJLabel 93 totalJLabel = new JLabel(); 94 totalJLabel.setText( "Total:" ); 95 totalJLabel.setBounds( 204, 16, 40, 21 ); 96 contentPane.add( totalJLabel ); // set up totalResultJTextField 99 totalResultJTextField = new JTextField(); 100 totalResultJTextField.setBounds( 244, 16, 86, 21 ); 101 totalResultJTextField.setHorizontalAlignment( 102 JTextField.RIGHT ); 103 totalResultJTextField.setEditable( false ); // output only 104 contentPane.add( totalResultJTextField ); // set up calculateJButton 107 calculateJButton = new JButton(); 108 calculateJButton.setText( "Calculate Total" ); 109 calculateJButton.setBounds( 204, 48, 126, 24 ); 110 contentPane.add( calculateJButton ); 111 calculateJButton.addActionListener( 112

 2004 Prentice Hall, Inc. All rights reserved. Outline 21 Inventory.java (6 of 8) 113 new ActionListener() // anonymous inner class 114 { 115 // method called when calculateJButton is pressed 116 public void actionPerformed( ActionEvent event ) 117 { 118 calculateJButtonActionPerformed( event ); 119 } } // end anonymous inner class ); // end call to addActionListener // set properties of application’s window 126 setTitle( "Inventory" ); // set title bar text 127 setSize( 354, 112 ); // set window size 128 setVisible( true ); // display window } // end method createUserInterface // calculate the total items in the shipment 133 private void calculateJButtonActionPerformed( ActionEvent event ) 134 {

 2004 Prentice Hall, Inc. All rights reserved. Outline 22 Inventory.java (7 of 8) 135 // declare variables 136 int cartons; // stores number of cartons in shipment 137 int items; // stores number of items per carton 138 int result; // stores product of cartons and items // retrieve numbers from text fields 141 cartons = Integer.parseInt( cartonsJTextField.getText() ); 142 items = Integer.parseInt( itemsJTextField.getText() ); // multiply values input 145 result = cartons * items; // display result in totalResultJTextField 148 totalResultJTextField.setText( String.valueOf( result ) ); } // end method calculateJButtonActionPerformed 151 Use keyword int to declare variables inside an event handler Assigning a value to a variable Calculating a result Displaying a variable’s value

 2004 Prentice Hall, Inc. All rights reserved. Outline 23 Inventory.java (8 of 8) 152 // clear totalResultJTextField because the value is now invalid 153 private void cartonsJTextFieldKeyPressed( KeyEvent event ) 154 { 155 totalResultJTextField.setText( "" ); // clear output JTextField } // end method cartonsJTextFieldKeyPressed // clear totalResultJTextField because the value is now invalid 160 private void itemsJTextFieldKeyPressed( KeyEvent event ) 161 { 162 totalResultJTextField.setText( "" ); // clear output TextField } // end method itemsJTextFieldKeyPressed // main method 167 public static void main( String[] args ) 168 { 169 Inventory application = new Inventory(); 170 application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); } // end method main } // end class Inventory Setting a JTextField ’s text property to the empty string

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Memory Concepts Figure 5.15 Memory location showing name and value of variable cartons. locations – variable names correspond to locations in computer’s memory

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Memory Concepts (Cont.) Figure 5.16 Memory locations after assigning values to cartons and items. 10 items cartons 12

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Memory Concepts (Cont.) Figure 5.17 Memory locations after a multiplication operation. cartons items result

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Arithmetic Arithmetic operators – special symbols to perform arithmetic functions – binary operators: require two operands – unary operators: require one operand

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Arithmetic (Cont.)

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands Debugger – analyze behavior of applications to locate and remove logic errors – logic error: application compiles successfully, but produces erroneous results – break points: markers set at any executable line of code

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.20 Starting the Java debugger. Start the Java debugger Running the debugger – type javac –g ApplicationName.java – type jdb

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.21 Running the Inventory application through the debugger. Run the Inventory application Running the debugger (cont.) – type run ApplicationName Inventory application

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.22 Restarting the debugger. Restart the debugger Restarting the debugger –type jdb

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.23 Setting two breakpoints. Set a breakpoint at line 148 Set a breakpoint at line 145 Setting breakpoints – type stop at ApplicaitonName:line#

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.24 Restarting the Inventory application. Restart the Inventory application Inventory application

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.25 Reaching the first breakpoint. Next line of code to be executed Breakpoint is reached Paused Inventory application

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.26 Execution reaches the second breakpoint. Another breakpoint is reached After breakpoint is reached, type cont to continue running application

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.27 Examine the values of three variables. The value of items The value of cartons The value of result The print command – prints current value held by variable – type print variableName

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.28 Execution resumes. Execution resumes

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.29 Remove the breakpoints. Both breakpoints are removed Clear breakpoint at line 148 Clear breakpoint at line 145 Two breakpoints are set

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.30 Application executes with no breakpoints set.

© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Using the Debugger: Breakpoints and the run, stop, cont and print Commands (Cont.) Figure 5.31 Exiting the debugger.