© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 1 Unit 3 Formatting Chapter 3 Input, Variables, Constants,

Slides:



Advertisements
Similar presentations
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Advertisements

Chapter 2 –Visual Basic, Controls, and Events
Exploring Office Grauer and Barber 1 Creating More Powerful Applications: Introduction to VBA(Wk9)
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Chapter 2 –Visual Basic, Controls, and Events
CS0004: Introduction to Programming Events. Review  Event Procedure  A set of instructions to be executed when a certain event happens.  Many event-driven.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 1: Chapter 2: Slide 1 Unit 1 Introduction to Programming Using VB.NET Chapter.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
Visual Basic Chapter 1 Mr. Wangler.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
CS0004: Introduction to Programming Input and Output.
Starting Out with Visual Basic.NET 2 nd Edition Chapter 3 Input, Variables, Constants, And Calculations.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
Multiple Forms, Standard Modules, And Menus
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
Chapter 6 Understanding the Structure of an Application: Procedures, Modules, and Classes.
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Chapter 3 Introducing Visual Basic.NET. 3.1 Visual Basic.NET Windows Programming -Used to create Windows, Web, and Console applications -Uses predefined.
Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
Chapter 3 Part 21 Displaying Output Chapter 3 Section 3.5Output Formatting Chapter 3 Section 3.6Group Boxes, etc. Chapter 3 Section 3.7Sample Program Chapter.
Chapter 3 – Fundamentals of Programming in VB.NET VB.NET Controls VB.NET Events Numbers Strings Input and Output.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 5 Decision Making.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
Introduction to Visual Basic.NET Chapter 2 Introduction to Controls, Events.
Chapter 9: MuPAD Programming II Procedures MATLAB for Scientist and Engineers Using Symbolic Toolbox.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Microsoft Visual Basic 2008 CHAPTER TWELVE Cell Phone Applications and Web Services.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 8: Chapter 5: Slide 1 Unit 8 List Boxes and the Do While Looping Structure.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 10: Chapter 6: Slide 1 Unit 10 Sub Procedures and Functions Chapter 6 Sub.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 8 What’s Wrong with It?
Chapter 11: Introduction to VBA Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
4-1 Chapter 4 The Selection Process in VB.NET. 4-2 Learning Objectives Understand the importance of the selection process in programming. Describe the.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
Visual Basic.NET Programming for the Rest of Us Keith Mulbery Utah Valley State College.
Chapter 7 What’s Wrong with It? (Syntax and Logic Errors) Clearly Visual Basic: Programming with Visual Basic nd Edition.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Chapter 2 - VB 2008 by Schneider1 Chapter 2 –Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Instructors: Sidra Ehsan Budoor Bawazeer CpCS 206.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Computer Science Up Down Controls, Decisions and Random Numbers.
Visual Basic Fundamental Concepts
A variable is a name for a value stored in memory.
Chapter 2: The Visual Studio .NET Development Environment
Chapter 1: An Introduction to Visual Basic 2015
An Application Uses Variables to Hold Information So It May Be Manipulated, Used to Manipulate Other Information, or Remembered for Later Use.
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
Computer Programming I
CHAPTER FIVE Decision Structures.
3.01 Apply Controls Associated With Visual Studio Form
Using Procedures and Exception Handling
Objectives Learn about Function procedures (functions), Sub procedures (subroutines), and modules Review and modify an existing subroutine in an event.
CHAPTER FIVE Decision Structures.
Variables and Arithmetic Operations
Visual Basic..
Visual Basic Programming Chapter Four Notes Working with Variables, Constants, Data Types, and Expressions GROUPBOX CONTROL The _____________________________________.
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
GUI Programming in Visual Studio .NET
Presentation transcript:

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 1 Unit 3 Formatting Chapter 3 Input, Variables, Constants, and Calculations

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 2 Formatting Numbers for Output Numbers May Be Formatted in Various Ways for Output

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 3 FormatNumber Function FormatNumber(expression [, DecimalPoints]) The expression is evaluated and output as a number The optional second argument gives the number of requested decimal places

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 4 FormatCurrency Function FormatCurrency(expression [, DecimalPoints]) The expression is evaluated and output as a currency value based on your PCs local options The optional second argument gives the number of requested decimal places

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 5 FormatPercent Function FormatPercent(expression [, DecimalPoints]) The expression is evaluated and output as a percentage value The optional second argument gives the number of requested decimal places

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 6 FormatDateTime Function FormatDateTime(expression [, Format]) The expression is evaluated and output as a date and time value based on Format The optional second argument gives the requested format, e.g.  DateFormat.GeneralDate  DateFormat.LongDate  Etc.

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 7 Group Boxes, Form Formatting, and the Load Event Procedure In This Section We Discuss the GroupBox Control, Which Is Used to Group Other Controls, and How to Align and Center Controls on a Form

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 8 Group Box A Group Box creates a Logical and Physical grouping of controls  Physical: They are surrounded by a box and have a title  Logical: The controls within the box have a tab ordering within the Group box

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 9 Placing Controls within a Group Box Select the Group Box then double click a control to add to the group, or Select the Group Box then click the desired tool in the toolbox and draw the control inside the Group Box, or Cut a control, select the Group Box, and then paste the control

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 10 Form Formatting, I The form defaults to an 8x8 "snap to" grid This can be modified by going to Tools/Options and then selecting "Windows Forms Designer"  Modify the granularity of the grid  Show the grid or not  Either use "snap to" or not Multiple controls can be selected simultaneously by:  Click and dragging an area and/or  Ctrl-Clicking individual objects

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 11 Form Formatting, II Once selected controls may be organized via:  Align lefts  Align centers  Align rights  Align tops  Align middles  Align bottoms Other submenu operations include:  Same Size  Horizontal and Vertical Spacing  Center in Form  Order

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 12 Load Event Procedure Every form has a Load event procedure It is executed each time the form loads into memory Need to execute some code at that time: Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load ' Code to be executed when the Form loads End Sub

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 13 More About Debugging: Locating Logic Errors Visual Basic.NET Allows You to Pause a Program, Then Execute Its Statements One at a Time After Each Statement Executes, You May Examine Variable Contents and Property Values

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 14 Debugging Problem The program does not work correctly (has one or more logic errors) Running the program with various inputs has not isolated where those logic errors are hiding What can be done?

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 15 Visual Basic.NET Debugging Aids Single Step through the program This amounts to executing the program a statement at a time One can then see and examine:  What is happening one statement at a time  Where it is happening  What the various data values are (Watches) Related debugging tools include  Executing to a breakpoint (placed just before you think the program's logic error may be)  Examining the values of expressions