Programming Lecture #3 CS 101 Autumn 2006 Tariq Jadoon.

Slides:



Advertisements
Similar presentations
Chapter 13 Control Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Control Structures Conditional.
Advertisements

CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
Time (h), x 0123 Distance (m) y Time studying (h), x 0123 grade (%) y
ECE Application Programming
Pascal Programming Today Chapter 4 1 »Conditional statements allow the execution of one of a number of possible operations. »Conditional statements include:
Programming Lecture #2 CS 101 Autumn 2007 Tariq Jadoon.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
CS Data Structures Appendix 1 How to transfer a simple loop- expression to a recursive function (factorial calculation)
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
CS101- Lecture 11 CS101 Fall 2004 Course Introduction Professor Douglas Moody –Monday – 12:00-1:40 – – –Web Site: websupport1.citytech.cuny.edu.
Programming Lecture #4 CS 101 Autumn 2006 Tariq Jadoon.
Statistics 350 Lecture 11. Today Last Day: Start Chapter 3 Today: Section 3.8 Mid-Term Friday…..Sections ; ; (READ)
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
Problem Solving Chapter 2. What is an algorithm? n A solution to a problem that is: –Precise –Effective –Terminating.
1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.
Chapter 9 IF Statement Bernard Chen. If Statement The main statement used for selecting from alternative actions based on test results It’s the primary.
CHAPTER 7-1 SOLVING SYSTEM OF EQUATIONS. WARM UP  Graph the following linear functions:  Y = 2x + 2  Y = 1/2x – 3  Y = -x - 1.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC BUILDING BLOCKS Bilal Munir Mughal 1 Chapter-5.
Lab 01 Forms in excel Tahani ALdweesh Insert form into your project. 2. Change form’s properties. 3. Put controls on the form. 4. Change controls’
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 7.1 Test-Driving the Wage Calculator Application.
MAT Meyer Week 2 Programming VB: ‘basics’ Review & preview: Events, variables, statements, etc. Images, Control arrays, For/Next Assignment: read.
VB – Debugging Tools Appendix D. Why do we need debugging? Every program has errors, and the process of finding these errors is debugging Types of errors.
Chapter 1 Section 1.1Functions. Functions A Notation of Dependence ◦ What does that mean? Rule which takes certain values as inputs and assigns them exactly.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Graph y = 2 3
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview How to create a first ASP.NET application.
Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables.
Chapter 5: ANALYTIC TRIGONOMETRY. Learning Goal I will be able to use standard algebraic techniques and inverse trigonometric functions to solve trigonometric.
Conditional Expression One of the most useful tools for processing information in an event procedure is a conditional expression. A conditional expression.
Debugging Xin Tong. GDB GNU Project debugger Allows you to see what is going on `inside' another program while it executes or crashed. (Faster than printing.
Lecture Notes - Copyright © S. C. Kothari, All rights reserved.1 Efficient Debugging CPRE 556 Lecture 19.
The Functions and Purposes of Translators Syntax (& Semantic) Analysis.
Debuggers in Python. The Debugger Every programming IDE has a tool called a debugger. This application does NOT locate or fix your bugs for you! It slows.
Chapter 11: Introduction to VBA Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Review for Final Exam. Contents 5 questions (20 points each) + 1 bonus question (20 points) – Basic concepts in Chapters 1-4 – Chapters 5-9 – Bonus: Chapter.
More on Loop Optimization Data Flow Analysis CS 480.
CECS 5020 Computers in Education Visual Basic Variables and Constants.
CS130 Visual Basic Project 4 Lecture Fall New topics in project 4 Database, file (table), records, fields. Application that contains menus, submenus,
Visual Basic Integrated Development Environment (IDE) 56:150 Information System Design.
Debugging and Printing George Mason University. Today’s topics Review of Chapter 3: Printing and Debugging Go over examples and questions debugging in.
An introduction to the debugger And jGrasp editor-syncrasies (ideosyncrasies)
Chapter 7 What’s Wrong with It? (Syntax and Logic Errors) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Department of Electronic & Electrical Engineering Statements Blocks{} Semicolons ; Variables Names keywords Scope.
Lesson 3-6 Absolute Value Equations Objectives: To solve equations and inequalities that involve absolute value.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
An Introduction to Programming with C++1 The Selection Structure Tutorial 6.
C Program Control September 15, OBJECTIVES The essentials of counter-controlled repetition. To use the for and do...while repetition statements.
Chapter 8 The Tower of Babel. Procedural Languages – Figure 8.1 User-Hardware Interface and Programming Languages (a) A High-Level Language Shields the.
ECE Application Programming
Visual Basic Code & No.: CS 218
1-1 Logic and Syntax A computer program is a solution to a problem.
Introduction to VB6 Week 1 3/2/2004 PPCC - Introduction to VB6
Algebra 1 Section 2.3 Subtract real numbers
Microsoft Office Illustrated
DEBUGGING.
Microsoft Visual Basic 2005 BASICS
1.2 Introduction to Graphing Equations
Visual Basic 6 Programming.
Programming Right from the Start with Visual Basic .NET 1/e
CSCI 3328 Object Oriented Programming in C# Chapter 4: C# Control Statement – Part I – Exercises UTPA – Fall 2012 This set of slides is revised from lecture.
Review for Final Exam.
The University of Texas – Pan American
Visual Basic – Decision Statements
Review for Final Exam.
Debugging Visual Basic Programs
Intro to Programming Concepts
jGRASP editor-syncrasies (idiosyncrasies)
Programming Control Structures with JavaScript
Completing the Square.
To Start: 15 Points Evaluate: * 6 – 2 3(6 +2) – 2 3{6 +(3 * 4)}
Presentation transcript:

Programming Lecture #3 CS 101 Autumn 2006 Tariq Jadoon

In Lecture #2 Variables and Assignment statements New Controls –Label –CommandButton –Textbox

Variables & Assignment Statements A variable is a named storage space –Naming variables follows certain simple rules: [See page 19 Chapter 2 of Visual Basic Schaum’s outline] Assignment statements assign values to variables: Variable = Expression An assignment statement is NOT an equation

1 4 Variables & Assignment Statements X = 1 X = 4 Y = X XY 4

Processor Variables & Assignment Statements 4 X = 1 X = 4 Y = X X = Y + 2 XY =6 6

Today Swapping Variables Debugging Tools –Immediate Window –Single Stepping –Watch Conditional Statements

10 Swapping the Contents of Two Variables X = 10 Y = 20 XY 20

10 Swapping the Contents of Two Variables X = 10 Y = 20 X = Y XY 20

10 Swapping the Contents of Two Variables X = 10 Y = 20 Y = X XY 10 20

Swapping the Contents of Two Variables X = 10 Y = 20 Temp = Y Y = X X Y Temp 20 10

Swapping the Contents of Two Variables X = 10 Y = 20 Temp = Y Y = X X = Temp X Y 10 Temp 20

Debugging Using the Immediate Window as a scratchpad Placing Breakpoints Single stepping (F8) Placing Watches

Conditional Code VB has a number of block structures for conditional code: IF condition THEN action IF condition THEN action1 action2... END IF

Conditional Code (contd.) IF condition THEN action1 … ELSE action2 … END IF