Visual Basic.NET Fundamentals. Objectives Use primitive data types, naming conventions, and style rules Understand and apply the control structures supported.

Slides:



Advertisements
Similar presentations
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Advertisements

Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
CS0004: Introduction to Programming Repetition – Do Loops.
ITEC113 Algorithms and Programming Techniques
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 4 – Introducing Algorithms, Pseudocode and.
Chapter 4 General Procedures
IS 1181 IS 118 Introduction to Development Tools VB Chapter 06.
VBA Modules, Functions, Variables, and Constants
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 3, Lecture 2.
Program Design and Development
Control Structures: Part 2. Introduction Essentials of Counter-Controlled Repetition For / Next Repetition Structure Examples Using the For / Next Structure.
ECE122 L11: For loops and Arrays March 8, 2007 ECE 122 Engineering Problem Solving with Java Lecture 11 For Loops and Arrays.
CSC110 Fall Chapter 5: Decision Visual Basic.NET.
Chapter 4 - VB.Net by Schneider1 Chapter 4 General Procedures 4.1 Sub Procedures, Part I 4.2 Sub Procedures, Part II 4.3 Function Procedures 4.4 Modular.
Data Types and Operations Programming Fundamentals (Writing Code)Programming Fundamentals (Writing Code)
CS241 PASCAL I - Control Structures1 PASCAL I - Control Structures Philip Fees CS241.
VB Code Statements 3 types of VB statement The Remark statement, known as comments, are used for project documentation only Begin with an apostrophe Not.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
VB .NET Programming Fundamentals
5.05 Apply Looping Structures
Variables and Constants
CIS Computer Programming Logic
CHAPTER THREE Representing Data: Constants and Variables.
Flow of Control. 2 Control Structures Control structure: An instruction that determines the order in which other instructions in a program are executed.
Decision Structures and Boolean Logic
Lecture Set 5 Control Structures Part D - Repetition with Loops.
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
5-1 Chapter 5 The Repetition Process in VB.NET. 5-2 Learning Objectives Understand the importance of the repetition process in programming. Describe the.
 2002 Prentice Hall. All rights reserved. 1 Chapter 5 – Control Structures: Part 2 Outline 5.1Introduction 5.2 Essentials of Counter-Controlled Repetition.
Representing Data: Constants and Variables CHAPTER THREE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
Arrays Module 6. Objectives Nature and purpose of an array Using arrays in Java programs Methods with array parameter Methods that return an array Array.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Mr. Dave Clausen1 La Cañada High School Chapter 6: Repetition Statements.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
Chapter 5: Control Structures: Iteration Visual Basic.NET Programming: From Problem Analysis to Program Design.
Controlling Execution Programming Right from the Start with Visual Basic.NET 1/e 8.
VBScript Language. What is VBScript Based on the Visual Basic family of languages Supports object oriented features Interpreted Loosely Typed Implicitly.
Visual Basic.net Loops. Used to do multiple executions of the same block of code Do while loops Do until loops For next loops.
COMPUTER PROGRAMMING I 5.05 Apply Looping Structures.
An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure.
Visual Basic Programming
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
Bordoloi and Bock Control Structures: Iterative Control.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC PROGRAMMING FUNDAMENTALS Bilal Munir Mughal 1 Chapter-8.
Introduction to Problem Solving and Control Statements.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Programming with Microsoft Visual Basic th Edition
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Visual Basic CDA College Limassol Campus COM123 Visual Basic Programming Semester C Lecture:Pelekanou Olga Week 3: Using Variables.
5.1 Introduction Problem Solving –Requires understanding of: Building blocks Program-construction principles BZUPAGES.COM.
CHAPTER THREE Representing Data: Constants and Variables.
Controlling Program Flow with Decision Structures.
Making Interactive Programs with Visual Basic .NET
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Representing Data: Constants and Variables
A variable is a name for a value stored in memory.
Test 2 Review Outline.
Chapter 5- Control Structures: Part 2
Control Structures: Part 2
Topics The if Statement The if-else Statement Comparing Strings
Chapter 3: Understanding C# Language Fundamentals
Chapter 5 Structures.
Topics The if Statement The if-else Statement Comparing Strings
Chapter 6 Control Statements: Part 2
Fundamentals of visual basic
Flow of Control.
Controlling Program Flow
Objectives Use primitive data types, naming conventions, and style rules Understand and apply the control structures supported in Visual Basic .NET Explain.
Presentation transcript:

Visual Basic.NET Fundamentals

Objectives Use primitive data types, naming conventions, and style rules Understand and apply the control structures supported in Visual Basic.NET Explain the objects and techniques involved in the creation of a Multiple Document Interface (MDI) application Understand the purpose and uses of these new Windows Forms controls: TabControl, ComboBox, CheckBox, GroupBox, and RadioButton

Using Primitive Data Types, Naming Conventions, and Style Rules Data Types –Literal Has the face value of each occurrence –Constant Is assigned a literal value that does not change –Variable Is a symbolic reference to an address in memory Values stored memory block can change during program execution Naming Conventions –Facilitate program readability, understandability, and maintainability –Programmer-supplied names must be meaningful –Variable names are mixed case and consist of a prefix and a meaningful name

Using Primitive Data Types, Naming Conventions, and Style Rules (Continued) Example variable declarations –Dim mdecInterestRate As Decimal - A module-level decimal –Public pastructUser - A public array of structures –Static stintLineCtr - A static integer –Dim strMessage - A dynamic local string Naming constants –Const DAYSINWEEK = 7 Naming functions –Private Function GetNextRecord() –Public Sub FindLastName() –Protected Sub EnableDisableTextboxes(vbln As Boolean) Naming classes –Public Class Student –Public Class AcademicProgram Naming controls –Controls have a prefix indicating the control’s class

Coding Conventions and Style Rules Purpose: to increase code readability, and, therefore, make it easier to revise and debug Using indentation –To visually identify groups of related statements Declaring variables at the lowest level –If variable needed only inside a procedure, declare it inside that procedure –If variable needed only in one form, declare it at form level in that form –If a variable is needed only inside a standard module, declare it as a Private variable inside that module Using constants –Use constants rather than numeric values when possible –Constants improve program readability and also facilitate program maintenance Writing code that is easy to read –Try to write code that is easy to read, follow, and understand

Control Structures and Structured Programming Control structure –A method of controlling the execution sequence of instructions at runtime Characteristics of structured programs –Limited to sequence, selection, and iteration, with unlimited nesting –Every procedure has a single entry point and a single exit point –Using stepwise refinement, programs are broken down logically or functionally into relatively small blocks of code –Variables are declared at lowest possible level –Global variables are used minimally, if at all Stub –A placeholder for a section of code that will be developed later

Visual Basic.NET Control Structures Sequence structure –One statement after another Selection structure –Includes the If statement, Select Case statement, Immediate If function, and Try statement Iteration structures –Provide for the repeated execution of a statement block If statement –Allows you to specify a condition or test, and if that condition is met, to then execute one or more imperative statements

Logical Operators And –The result is True only when condition A and conditionB are both True Or –The result is True if at least one of conditionA or conditionB is True AndAlso –The result is True only when conditionA and conditionB are both True OrElse –The result is True if at least one of conditionA or conditionB is True Xor –The result is True only when one and only one of conditionA and conditionB is True

Truth Table for Visual Basic.NET Logical Operators

Visual Basic.NET Control Structures (Continued) Select case –Useful when the evaluation of a single expression can determine multiple paths Immediate If (IIf) –Examines and returns if the condition is True; otherwise, it returns –Syntax: = IIf(,, ) Try … Catch … Finally –Provides a structured programming solution to the problem of error trapping Do loops –Principal form of externally controlled loops –Pretest loop –Posttest loop –While test –Until test

For Loop Internally controlled loop Requires –Loop control variable (LCV) –Initial value for the LCV –Limit value for the LCV –Step value –Test to determine whether the LCV’s limit value has been reached (after which the loop is exited)

Using a For Loop for a Sequential Search