Relational Operators. > greater than < less than >= greater than or equal to <= less than or equal to <> not equal to = equal to

Size: px
Start display at page:

Download "Relational Operators. > greater than < less than >= greater than or equal to <= less than or equal to <> not equal to = equal to"

Transcription

1 Relational Operators > greater than < less than >= greater than or equal to <= less than or equal to <> not equal to = equal to

2 Conditions Conditions are expressions that involve relational operators Example: A < B, A <> B, etc. where A, B are either numbers, or strings

3 More complex conditions More complex conditions can be formed using expressions involving simple conditions and logical operators. cond1 And cond2 cond1 Or cond2 Not cond1

4 What does A < B mean for two strings A, B? A precedes B lexicographically in the ANSI character set (as in a dictionary)

5 Controlling Program Flow Conditional Execution If condition Then do action1 Else action2 End If

6 Pseudo code If condition is true Then execute code 1 Else execute code 2 End If

7 Example Given two numbers A and B, print A if A < B, and print B if B <= A If A < B Then Print A Else Print B End If

8 The Else part can be absent Example: If A < B Then Print A End If

9 Pseudo code for another example: Input two numbers A, B If A < B then print the difference A-B Else print the difference B-A Lets consider the code below:

10 Private Sub Command1_Click() Dim A, B, D As Integer A = Text1.Text B = Text2.Text If A < B Then D = B - A Print D Else D = A - B Print D End If End Sub

11 Private Sub Command1_Click() Dim A, B, D As Integer A = Val(Text1.Text) B = Val(Text2.Text) If A < B Then D = B - A Print D Else D = A - B Print D End If End Sub

12 Another If statement can be in the Then or Else part of the If statement Pseudo code: Input two numbers A, B If A < B Then Print A-B Else If A > B Then Print B-A Else Print A and B are equal

13 Private Sub Command1_Click() Dim A, B As Integer A = Val(Text1.Text) B = Val(Text2.Text) If A < B Then Print B - A Else If A > B Then Print A - B Else Print "A and B are equal" End If End If End Sub

14 The ElseIf clause If there are more than two alternatives, the ElseIf clause is a cleaner, more readable way to write the code It is equivalent logically to the previous code

15 If cond1 Then action1 ElseIf cond2 Then action2 ElseIf cond3 Then action3 Else action4 End If

16 Private Sub Command1_Click() Dim A, B As Integer A = Val(Text1.Text) B = Val(Text2.Text) If A < B Then Print B - A ElseIf A > B Then Print A - B Else Print "A and B are equal" End If End Sub

17 What if we had more alternatives? If cond1 Then action1 ElseIf cond2 Then action2 ElseIf cond3 Then action3 Else action4 End If

18 Select Case Statement If we have to choose among a set of alternatives, a Select Case statement is cleaner, more readable Select Case statement is equivalent to If statement with ElseIf

19 Select Case Statement Select Case selector Case valuelist1 action1 Case valuelist2 action2.. Case Else action for fall through End Select

20 Select Case choices are determined by the value of an expression called selector Case valuelist1 action1 action1 is carried out if the value of selector lies in the range specified in valuelist1

21 valuelist1, valuelist2, etc. can be one or more of the following types of items seperated by commas: A constant A variable An expression An inequality sign preceded by Is and followed by a constant, variable, or expression A range expressed as a To b, where a,b are constants, variables or expressions

22 Example Select Case Grade Case Is > 90 yourgrade = A Case Is >= 80 yourgrade = B End Select If Grade is 95, it lies in both ranges > 90, and >= 80. The first valuelist item containing the selector is chosen, and corresponding action carried out

23 Example Select Case Grade Case Is > 90 yourgrade = A Case Is > 80 yourgrade = B Case Is > 70 yourgrade = C Case Else Please retake the Final End Select

24 Private Sub Command1_Click() Select Case Val(Text1.Text) Case Is > 90 Print "your grade is A" Case Is > 80 Print "your grade is B" Case Is > 70 Print "your grade is C" Case Is > 60 Print "your grade is D" Case Else Print Please retake Final" End Select End Sub

25 Case Else (and corresponding action) is optional Can we replace above Select Case by the following If Then statements? If Val(Text1.Text) > 90 Then Print your grade is A If Val(Text1.Text) > 80 Then Print your grade is B...

Function: function procedures and sub procedures share the same characteristics, with

Function: function procedures and sub procedures share the same characteristics, with Function: function procedures and sub procedures share the same characteristics, with one important difference- function procedures return a value (e.g., give a value back) to the caller, whereas sub procedures

More information

Introduction to Visual Basic and Visual C++ Arithmetic Expression. Arithmetic Expression. Using Arithmetic Expression. Lesson 4.

Introduction to Visual Basic and Visual C++ Arithmetic Expression. Arithmetic Expression. Using Arithmetic Expression. Lesson 4. Introduction to Visual Basic and Visual C++ Arithmetic Expression Lesson 4 Calculation I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Arithmetic Expression Using Arithmetic Expression Calculations

More information

IS 320 Spring 96 Page 1 Exam 1. Please use your own paper to answer the following questions. Point values are shown in parentheses.

IS 320 Spring 96 Page 1 Exam 1. Please use your own paper to answer the following questions. Point values are shown in parentheses. IS 320 Spring 96 Page 1 Please use your own paper to answer the following questions. Point values are shown in parentheses. 1. (10) Consider the following segment of code: If txtansicode.text < "0" Or

More information

Review for Exam 2. IF Blocks. Nested IF Blocks. School of Business Eastern Illinois University. Represent computers abilities to make decisions

Review for Exam 2. IF Blocks. Nested IF Blocks. School of Business Eastern Illinois University. Represent computers abilities to make decisions School of Business Eastern Illinois University Review for Exam 2 - IF Blocks - Do s - Select Case Blocks (Week 10, Friday 3/21/2003) Abdou Illia, Spring 2003 IF Blocks 2 Represent computers abilities to

More information

2Practicals Visual Basic 6.0

2Practicals Visual Basic 6.0 2Practicals Visual Basic 6.0 Practical 1: 1. Navigation of Visual Basic Integrated Development Environment The Visual Basic IDE is made up of a number of components Menu Bar Tool Bar Project Explorer Properties

More information

Angel International School - Manipay 1 st Term Examination November, 2015

Angel International School - Manipay 1 st Term Examination November, 2015 Grade 10 Angel International School - Manipay 1 st Term Examination November, 2015 Information & Communication Technology Duration: 3.00 Hours Part 1 Choose the appropriate answer 1) Find the correct type

More information

Review. October 20, 2006

Review. October 20, 2006 Review October 20, 2006 1 A Gentle Introduction to Programming A Program (aka project, application, solution) At a very general level there are 3 steps to program development Determine output Determine

More information

Chapter 8 Statement-Level Control Structures

Chapter 8 Statement-Level Control Structures Chapter 8 Statement-Level Control Structures In Chapter 7, the flow of control within expressions, which is governed by operator associativity and precedence rules, was discussed. This chapter discusses

More information

CPSC 3740 Programming Languages University of Lethbridge. Control Structures

CPSC 3740 Programming Languages University of Lethbridge. Control Structures Control Structures A control structure is a control statement and the collection of statements whose execution it controls. Common controls: selection iteration branching Control Structures 1 15 Howard

More information

Angel International School - Manipay 1 st Term Examination November, 2015

Angel International School - Manipay 1 st Term Examination November, 2015 Angel International School - Manipay 1 st Term Examination November, 2015 Information & Communication Technology Grade 11A & C Duration: 3.00 Hours Part 1 Choose the most appropriate answer. 1) Find the

More information

Programming with visual Basic:

Programming with visual Basic: Programming with visual Basic: 1-Introdution to Visual Basics 2-Forms and Control tools. 3-Project explorer, properties and events. 4-make project, save it and its applications. 5- Files projects and exercises.

More information

HELP - VB TIPS. ANIMATE AN IMAGE BOX Insert a module. In this module, create a global variable: Global x

HELP - VB TIPS. ANIMATE AN IMAGE BOX Insert a module. In this module, create a global variable: Global x HELP - VB TIPS Load an image to an image box from a certain folder If you use this method, won t work on N:\ To load an image to a image control Image1.Picture = LoadPicture("H:\MyVBfolder\stop.gif") Load

More information

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) Technology & Information Management Instructor: Michael Kremer, Ph.D. Database Program: Microsoft Access Series DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) AGENDA 3. Executing VBA

More information

(Subroutines in Visual Basic)

(Subroutines in Visual Basic) Ch 7 Procedures (Subroutines in Visual Basic) Visual Basic Procedures Structured Programs To simplify writing complex programs, most Programmers (Designers/Developers) choose to split the problem into

More information

Chap 6 - Introduction to HDL (b)

Chap 6 - Introduction to HDL (b) Design with Verilog Chap 6 - Introduction to HDL (b) Credit to: MD Rizal Othman Faculty of Electrical & Electronics Engineering Universiti Malaysia Pahang Ext: 6036 Language Elements 1. Operators There

More information

PROGRAM 1: SIMPLE CALCULATOR

PROGRAM 1: SIMPLE CALCULATOR PROGRAM 1: SIMPLE CALCULATOR Option Explicit Dim operand1 As Double, operand2 As Double Dim op1 As Double, op2 As Double Dim operator As String Dim cleardisplay As Boolean Private Sub Cmdclear_Click()

More information

The Control Properties

The Control Properties The Control Properties Figure Before writing an event procedure for the control to response to a user's input, you have to set certain properties for the control to determine its appearance and how it

More information

EMPLOYEE PAYROLL SYSTEM

EMPLOYEE PAYROLL SYSTEM EX.NO:1 DATE: EMPLOYEE PAYROLL SYSTEM AIM: To develop a Employee Payroll System using visual Basic. PROCEDURE: 1. Problem statement Software is to be designed for supporting a computerized employee payroll

More information

CMPT 110 MIDTERM OCTOBER 18, 2001

CMPT 110 MIDTERM OCTOBER 18, 2001 CMPT 110 MIDTERM OCTOBER 18, 2001 1 What will be displayed when the command button is clicked? 7% Level of difficulty 7 (out of 10) Assume there is a command button called cmdbutton Assume there is a picturebox

More information

VARIABLES. 1. STRINGS Data with letters and/or characters 2. INTEGERS Numbers without decimals 3. FLOATING POINT NUMBERS Numbers with decimals

VARIABLES. 1. STRINGS Data with letters and/or characters 2. INTEGERS Numbers without decimals 3. FLOATING POINT NUMBERS Numbers with decimals VARIABLES WHAT IS A VARIABLE? A variable is a storage location in the computer s memory, used for holding information while the program is running. The information that is stored in a variable may change,

More information

3. Can every Do-Loop loop be written as a For-Next loop? Why or why not? 4. Name two types of files that can be opened and used in a VB program.

3. Can every Do-Loop loop be written as a For-Next loop? Why or why not? 4. Name two types of files that can be opened and used in a VB program. CE 311 K Fall 005 Second Exam - Examples Answers at the bottom. 1. What are two categories of flow control structures?. Name three logical operators in Visual Basic (VB). 3. Can every Do-Loop loop be written

More information

Revision for Final Examination (Second Semester) Grade 9

Revision for Final Examination (Second Semester) Grade 9 Revision for Final Examination (Second Semester) Grade 9 Name: Date: Part 1: Answer the questions given below based on your knowledge about Visual Basic 2008: Question 1 What is the benefit of using Visual

More information

AIM To analyze, design and develop code for Online Course Reservation System using Rational Rose software

AIM To analyze, design and develop code for Online Course Reservation System using Rational Rose software Ex. No.1 Date: ONLINE COURSE RESERVATION AIM To analyze, design and develop code for Online Course Reservation System using Rational Rose software PROBLEM STATEMENT As the head of information systems for

More information

ElseIf: Another Conditional Statement

ElseIf: Another Conditional Statement If This, Then What? If color = true Then If thecolor = blue Then lblsuess.caption = blue fish lblsuess.caption = red fish lblsuess.caption = thenumber & & fish Take out a piece of paper. Write your name

More information

Before We Begin. Introduction to Computer Use II. Overview (1): Winter 2006 (Section M) CSE 1530 Winter Bill Kapralos.

Before We Begin. Introduction to Computer Use II. Overview (1): Winter 2006 (Section M) CSE 1530 Winter Bill Kapralos. Winter 2006 (Section M) Topic E: Subprograms Functions and Procedures Wednesday, March 8 2006 CSE 1530, Winter 2006, Overview (1): Before We Begin Some administrative details Some questions to consider

More information

( ) 1.,, Visual Basic,

( ) 1.,, Visual Basic, ( ) 1. Visual Basic 1 : ( 2012/2013) :. - : 4 : 12-14 10-12 2 http://www.institutzamatematika.com/index.ph p/kompjuterski_praktikum_2 3 2 / ( ) 4 90% 90% 10% 90%! 5 ? 6 "? : 7 # $? - ( 1= on 0= off ) -

More information

Lecture 5 Tao Wang 1

Lecture 5 Tao Wang 1 Lecture 5 Tao Wang 1 Objectives In this chapter, you will learn about: Selection criteria Relational operators Logical operators The if-else statement Nested if statements C++ for Engineers and Scientists,

More information

SMS 3515: Scientific Computing. Sem /2015

SMS 3515: Scientific Computing. Sem /2015 s s SMS 3515: Scientific Computing Department of Computational and Theoretical Sciences, Kulliyyah of Science, International Islamic University Malaysia. Sem 1 2014/2015 The if s that are conceptually

More information

Chapter 8. Statement-Level Control Structures

Chapter 8. Statement-Level Control Structures Chapter 8 Statement-Level Control Structures Levels of Control Flow Within expressions Among program units Among program statements Copyright 2012 Addison-Wesley. All rights reserved. 1-2 Control Structure

More information

OBJECT ORIENTED SIMULATION LANGUAGE. OOSimL Reference Manual - Part 1

OBJECT ORIENTED SIMULATION LANGUAGE. OOSimL Reference Manual - Part 1 OBJECT ORIENTED SIMULATION LANGUAGE OOSimL Reference Manual - Part 1 Technical Report TR-CSIS-OOPsimL-1 José M. Garrido Department of Computer Science Updated November 2014 College of Computing and Software

More information

The following expression causes a divide by zero error:

The following expression causes a divide by zero error: Chapter 2 - Test Questions These test questions are true-false, fill in the blank, multiple choice, and free form questions that may require code. The multiple choice questions may have more than one correct

More information

Programming in C. Pointers and Arrays

Programming in C. Pointers and Arrays Programming in C Pointers and Arrays NEXT SET OF SLIDES FROM DENNIS FREY S FALL 2011 CMSC313 http://www.csee.umbc.edu/courses/undergraduate/313/fall11/" Pointers and Arrays In C, there is a strong relationship

More information

Introductory Notes: Condition Statements

Introductory Notes: Condition Statements Brigham Young University - Idaho College of Physical Sciences and Engineering Department of Mechanical Engineering Introductory Notes: Condition Statements The simplest of all computer programs perform

More information

Remainder Cordial Labeling of Graphs

Remainder Cordial Labeling of Graphs Journal of Algorithms and Computation journal homepage: http://jac.ut.ac.ir Remainder Cordial Labeling of Graphs R. Ponraj 1, K. Annathurai and R. Kala 3 1 Department of Mathematics, Sri Paramakalyani

More information

20. VB Programming Fundamentals Variables and Procedures

20. VB Programming Fundamentals Variables and Procedures 20. VB Programming Fundamentals Variables and Procedures 20.1 Variables and Constants VB, like other programming languages, uses variables for storing values. Variables have a name and a data type. Array

More information

Visual Basic 6 Lecture 7. The List Box:

Visual Basic 6 Lecture 7. The List Box: The List Box: The function of the List Box is to present a list of items where the user can click and select the items from the list or we can use the List Box control as a simple memory to save data.

More information

Type Storage Range of Values

Type Storage Range of Values University of Misan College of Engineering Department of Civil Engineering Course Title: Visual Basic Second Stage Fourth Lecture Visual Basic Data There are many types of data that we come across in our

More information

Chapter Goals. 3.1 The if Statement. Contents 1/30/2013 DECISIONS

Chapter Goals. 3.1 The if Statement. Contents 1/30/2013 DECISIONS CHAPTER DECISIONS 3 Chapter Goals To implement decisions using the if statement To compare integers, floating-point numbers, and Strings To write statements using the Boolean data type To develop strategies

More information

Flow Control. CSC215 Lecture

Flow Control. CSC215 Lecture Flow Control CSC215 Lecture Outline Blocks and compound statements Conditional statements if - statement if-else - statement switch - statement? : opertator Nested conditional statements Repetitive statements

More information

8. Decision-Making Statements. Java. Summer 2008 Instructor: Dr. Masoud Yaghini

8. Decision-Making Statements. Java. Summer 2008 Instructor: Dr. Masoud Yaghini 8. Decision-Making Statements Java Summer 2008 Instructor: Dr. Masoud Yaghini Decision-Making Statements Outline Introduction The if-then Statement The if-then-else Statement The switch Statement References

More information

Microsoft Visual Basic 2005: Reloaded

Microsoft Visual Basic 2005: Reloaded Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 4 Making Decisions in a Program Objectives After studying this chapter, you should be able to: Include the selection structure in pseudocode

More information

CSU211 Exam 2 Fall 2007

CSU211 Exam 2 Fall 2007 CSU211 Exam 2 Fall 2007 Name: Student Id (last 4 digits): Instructor s Name: Write down the answers in the space provided. You may use the usual primitives and expression forms, including those suggested

More information

Java+- Language Reference Manual

Java+- Language Reference Manual Fall 2016 COMS4115 Programming Languages & Translators Java+- Language Reference Manual Authors Ashley Daguanno (ad3079) - Manager Anna Wen (aw2802) - Tester Tin Nilar Hlaing (th2520) - Systems Architect

More information

PROJECT ELECTRONIC CONTROL GAS INJECTION SYSTEM

PROJECT ELECTRONIC CONTROL GAS INJECTION SYSTEM PROJECT ELECTRONIC CONTROL GAS INJECTION SYSTEM SOURCE CODE VISUAL BASIC Dim WR As Boolean Dim pw Dim data Dim oxg Public index1 Dim index2 Dim k Dim u Dim refd Dim datar1$(1000, 9) Dim c_data Dim A$(10)

More information

Chapter 4 The If Then Statement

Chapter 4 The If Then Statement The If Then Statement Conditional control structure, also called a decision structure Executes a set of statements when a condition is true The condition is a Boolean expression For example, the statement

More information

151 Mixed bag of HOTS questions from VB 15 A VB program accepts a number in a text box and rounds the number to 0 decimal places. Write the VB code under the button cmdround to achieve this feature. Do

More information

Chapter 8 Statement-Level Control Structure

Chapter 8 Statement-Level Control Structure Chapter 8 Statement-Level Control Structure To make programs more flexible and powerful: Some means of selecting among alternative control flow paths. Selection statement (conditional statements) Unconditional

More information

Lecture 15 MATLAB II: Conditional Statements and Arrays

Lecture 15 MATLAB II: Conditional Statements and Arrays Lecture 15 MATLAB II: Conditional Statements and Arrays 1 Conditional Statements 2 The boolean operators in MATLAB are: > greater than < less than >= greater than or equals

More information

Mathematical Computing

Mathematical Computing Mathematical Computing IMT2b2β Department of Mathematics University of Ruhuna A.W.L. Pubudu Thilan Department of Mathematics University of Ruhuna Mathematical Computing 1/47 Programming in Maxima Department

More information

Visual Basic

Visual Basic 12-1 12-2 12-3 12-1.1 12-1.2 12-2.1 12-2.2 12-3.1 12-3.2 12-4 12-5 12-4.1 12-4.2 12-5.1 12-5.2 140 II 12-1 data file 12-1.1 record field 4 12-1 4 12 141 12-1... 12-1.2 sequential file random file binary

More information

VB komande. Programiranje 1

VB komande. Programiranje 1 VB komande Programiranje 1 Zadatak 1: Sastaviti program koji se sastoji iz jedne ListBox kontrole, jedne Textbox kontrole i dva komandna dugmeta. Klikom na prvo komandno dugme umeće se u ListBox sadržaj

More information

7 Control Structures, Logical Statements

7 Control Structures, Logical Statements 7 Control Structures, Logical Statements 7.1 Logical Statements 1. Logical (true or false) statements comparing scalars or matrices can be evaluated in MATLAB. Two matrices of the same size may be compared,

More information

Crystal Reports. Overview. Contents. Using Crystal Reports Print Engine calls (API) in Microsoft Visual Basic

Crystal Reports. Overview. Contents. Using Crystal Reports Print Engine calls (API) in Microsoft Visual Basic Using Crystal Reports Print Engine calls (API) in Microsoft Visual Basic Overview Contents This document describes how to preview a report using Microsoft (MS) Visual Basic, by making direct API calls

More information

LAMPIRAN A PROGRAM FLOWSTONE

LAMPIRAN A PROGRAM FLOWSTONE LAMPIRAN A PROGRAM FLOWSTONE A-1 Tampilan GUI pada FlowStone A-2 Program Tambahan yang Dibuat Untuk Membaca Frekuensi A-3 Program Tambahan yang Dibuat Untuk Menyimpan Data A-4 LAMPIRAN B PROGRAM VISUAL

More information

Chapter 8. Statement-Level Control Structures

Chapter 8. Statement-Level Control Structures Chapter 8 Statement-Level Control Structures Chapter 8 Topics Introduction Selection Statements Iterative Statements Unconditional Branching Guarded Commands Conclusions 1-2 Levels of Control Flow Within

More information

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017 Control Structures Lecture 4 COP 3014 Fall 2017 September 18, 2017 Control Flow Control flow refers to the specification of the order in which the individual statements, instructions or function calls

More information

Intrinsic Numeric Operations

Intrinsic Numeric Operations Intrinsic Numeric Operations The following operators are valid for numeric expressions: ** exponentiation (e.g., 10**2) evaluated right to left: 2**3**4 is evaluated as 2**(3**4) * and / multiply and divide

More information

Chapter 4 Decisions. Section 4.1 Relational and Logical Operators. 1. Asc("A") is 65. What is Asc("C")? (A) 66 (B) 67 (C) 68 (D) "C" B

Chapter 4 Decisions. Section 4.1 Relational and Logical Operators. 1. Asc(A) is 65. What is Asc(C)? (A) 66 (B) 67 (C) 68 (D) C B hapter 4 ecisions Section 4.1 Relational and Logical Operators 1. sc("") is 65. What is sc("")? () 66 () 67 () 68 () "" 2. sc("") is 65. What is displayed by txtox.ext = hr(65) & ""? () () () 656667 ()

More information

C++ Program Flow Control: Selection

C++ Program Flow Control: Selection C++ Program Flow Control: Selection Domingos Begalli Saddleback College, Computer Science CS1B, Spring 2018 1 / Domingos Begalli CS1B Spring 2018 C++ Introduction 1/19 19 Control program flow control structures

More information

CpSc 1111 Lab 6 Conditional Statements, Loops, the Math Library, and Random Numbers What s the Point?

CpSc 1111 Lab 6 Conditional Statements, Loops, the Math Library, and Random Numbers What s the Point? CpSc 1111 Lab 6 Conditional Statements, Loops, the Math Library, and Random Numbers What s the Point? Overview For this lab, you will use: one or more of the conditional statements explained below scanf()

More information

Trees. CS 5010 Program Design Paradigms Lesson 6.2

Trees. CS 5010 Program Design Paradigms Lesson 6.2 Trees CS 5010 Program Design Paradigms Lesson 6.2 Mitchell Wand, 2012-2014 This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. 1 Introduction/Outline Many

More information

โปรแกรมช วยทดสอบหม อแปลงกระแส

โปรแกรมช วยทดสอบหม อแปลงกระแส โปรแกรมช วยทดสอบหม อแปลงกระแส 1.เมน ของโปรแกรม ภาพท 1 หน าเมน ของโปรแกรม Public Class frmmain Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

More information

ECE468 Fall 2003, Final Exam

ECE468 Fall 2003, Final Exam Name ECE468 Fall 2003, Final Exam This test has 9 pages and 9 questions. When told to begin please check to make sure you have all 9 pages. Let us know immediately if it doesn t. This test is open book

More information

Lecture no

Lecture no Advanced Algorithms and Computational Models (module A) Lecture no. 3 29-09-2014 Giacomo Fiumara giacomo.fiumara@unime.it 2014-2015 1 / 28 Expressions, Operators and Precedence Sequence Operators The following

More information

An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is

An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is InputBox( ) Function An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is A = InputBox ( Question or Phrase, Window Title, ) Example1: Integer:

More information

CSc 372. Comparative Programming Languages. 36 : Scheme Conditional Expressions. Department of Computer Science University of Arizona

CSc 372. Comparative Programming Languages. 36 : Scheme Conditional Expressions. Department of Computer Science University of Arizona 1/26 CSc 372 Comparative Programming Languages 36 : Scheme Conditional Expressions Department of Computer Science University of Arizona collberg@gmail.com Copyright c 2013 Christian Collberg 2/26 Comparison

More information

Control Structures. March 1, Dr. Mihail. (Dr. Mihail) Control March 1, / 28

Control Structures. March 1, Dr. Mihail. (Dr. Mihail) Control March 1, / 28 Control Structures Dr. Mihail March 1, 2015 (Dr. Mihail) Control March 1, 2015 1 / 28 Overview So far in this course, MATLAB programs consisted of a ordered sequence of mathematical operations, functions,

More information

Ch. 7: Control Structures

Ch. 7: Control Structures Ch. 7: Control Structures I. Introduction A. Flow of control can be at multiple levels: within expressions, among statements (discussed here), and among units. B. Computation in imperative languages uses

More information

Herefordshire College of Technology Centre Edexcel BTEC Level 3 Extended Diploma in Information Technology (Assignment 1 of 3)

Herefordshire College of Technology Centre Edexcel BTEC Level 3 Extended Diploma in Information Technology (Assignment 1 of 3) Student: Candidate Number: Assessor: Len Shand Herefordshire College of Technology Centre 24150 Edexcel BTEC Level 3 Extended Diploma in Information Technology (Assignment 1 of 3) Course: Unit: Title:

More information

ISA PCI Peripherals Connect Interface ISA. Enhanced Parallel Port EPP

ISA PCI Peripherals Connect Interface ISA. Enhanced Parallel Port EPP ) ( 205 2003 4 ISA PCI Peripherals Connect Interface ISA Enhanced Parallel Port EPP IEEE 1284 1994 Intel Xircom Zenith 4-bit Nibble Mode EPP Enhanced Parallel Port ECP Extended Capabilities Parallel bi-direction

More information

QueueBlock, ReversalADT, LinkedList,CustomerAccount, not MaintainCustomerData

QueueBlock, ReversalADT, LinkedList,CustomerAccount, not MaintainCustomerData Naming Conventions Rules Classes Use nouns Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML) Begin with upper case

More information

CS Programming I: Branches

CS Programming I: Branches CS 200 - Programming I: Branches Marc Renault Department of Computer Sciences University of Wisconsin Madison Fall 2017 TopHat Sec 3 (PM) Join Code: 719946 TopHat Sec 4 (AM) Join Code: 891624 Boolean Statements

More information

Algorithms. M. R. C. van Dongen. ucc. LaTEX and Friends Algorithms. Marc van Dongen. Algorithms and Listings

Algorithms. M. R. C. van Dongen.  ucc. LaTEX and Friends Algorithms. Marc van Dongen. Algorithms and Listings and Listings http://csweb.ucc.ie/~dongen/laf/laf.html M. R. C. van Dongen ucc Loading the Package and Listings Use algorithm2e [Fiorio 2004] for pseudo code algorithms. Choosing right option saves time/space.

More information

There are algorithms, however, that need to execute statements in some other kind of ordering depending on certain conditions.

There are algorithms, however, that need to execute statements in some other kind of ordering depending on certain conditions. Introduction In the programs that we have dealt with so far, all statements inside the main function were executed in sequence as they appeared, one after the other. This type of sequencing is adequate

More information

Lecture 5. Review from last week. Selection Statements. cin and cout directives escape sequences

Lecture 5. Review from last week. Selection Statements. cin and cout directives escape sequences Lecture 5 Selection Statements Review from last week cin and cout directives escape sequences member functions formatting flags manipulators cout.width(20); cout.setf(ios::fixed); setwidth(20); 1 What

More information

Flow of Control. Flow of control The order in which statements are executed. Transfer of control

Flow of Control. Flow of control The order in which statements are executed. Transfer of control 1 Programming in C Flow of Control Flow of control The order in which statements are executed Transfer of control When the next statement executed is not the next one in sequence 2 Flow of Control Control

More information

Chapter 4: Making Decisions

Chapter 4: Making Decisions Chapter 4: Making Decisions 4.1 Relational Operators Relational Operators Used to compare numbers to determine relative order Operators: > Greater than < Less than >= Greater than or equal to

More information

V2 2/4/ Ch Programming in C. Flow of Control. Flow of Control. Flow of control The order in which statements are executed

V2 2/4/ Ch Programming in C. Flow of Control. Flow of Control. Flow of control The order in which statements are executed Programming in C 1 Flow of Control Flow of control The order in which statements are executed Transfer of control When the next statement executed is not the next one in sequence 2 Flow of Control Control

More information

Programming with Python

Programming with Python Programming with Python Dr Ben Dudson Department of Physics, University of York 21st January 2011 http://www-users.york.ac.uk/ bd512/teaching.shtml Dr Ben Dudson Introduction to Programming - Lecture 2

More information

Chapter 4: Making Decisions

Chapter 4: Making Decisions Chapter 4: Making Decisions CSE 142 - Computer Programming I 1 4.1 Relational Operators Relational Operators Used to compare numbers to determine relative order Operators: > Greater than < Less than >=

More information

CSc 520 Principles of Programming Languages

CSc 520 Principles of Programming Languages CSc 520 Principles of Programming Languages 36 : Scheme Conditional Expressions Christian Collberg Department of Computer Science University of Arizona collberg+520@gmail.com Copyright c 2008 Christian

More information

COGS 119/219 MATLAB for Experimental Research. Fall 2016 Week 1 Built-in array functions, Data types.m files, begin Flow Control

COGS 119/219 MATLAB for Experimental Research. Fall 2016 Week 1 Built-in array functions, Data types.m files, begin Flow Control COGS 119/219 MATLAB for Experimental Research Fall 2016 Week 1 Built-in array functions, Data types.m files, begin Flow Control .m files We can write the MATLAB commands that we type at the command window

More information

Python: Functions. Thomas Schwarz, SJ Marquette University

Python: Functions. Thomas Schwarz, SJ Marquette University Python: Functions Thomas Schwarz, SJ Marquette University History Early computer programming was difficult Not only because interacting with the computer was difficult Data was entered by setting switches,

More information

Algebraically Speaking Chalkdust Algebra 1 Fall Semester

Algebraically Speaking Chalkdust Algebra 1 Fall Semester Algebraically Speaking Chalkdust Algebra 1 Fall Semester Homework Assignments: Chapter 1 The Real Number System: Lesson 1.1 - Real Numbers: Order and Absolute Value Do the following problems: # 1 9 Odd,

More information

Visual Basic Visual Basic

Visual Basic Visual Basic 9-1 9-2 9-1.1 9-1.2 9-1.3 9-2.1 9-2.2 9-2.3 9-3 Visual Basic 9-3.1 Visual Basic 9-3.2 9-4 9-4.1 9-4.2 2 II 9-1 GoTo http://noi.stinfo.net/ xbqj/xbqj_12.htm structured programming 9-1 9-1 a goto b c goto

More information

( &% class MyClass { }

( &% class MyClass { } Recall! $! "" # ' ' )' %&! ( &% class MyClass { $ Individual things that differentiate one object from another Determine the appearance, state or qualities of objects Represents any variables needed for

More information

Sample Paper 2010 Class XII Subject Informatic Practices

Sample Paper 2010 Class XII Subject Informatic Practices Sample Paper 2010 Class XII Subject Informatic Practices (Section A) Q1. Answer the following Questions a) Visual Basic is not an Object Oriented Language Justify this statement. 2 b) How is a standard

More information

Chapter 4: Making Decisions. Copyright 2012 Pearson Education, Inc. Sunday, September 7, 14

Chapter 4: Making Decisions. Copyright 2012 Pearson Education, Inc. Sunday, September 7, 14 Chapter 4: Making Decisions 4.1 Relational Operators Relational Operators Used to compare numbers to determine relative order Operators: > Greater than < Less than >= Greater than or equal to

More information

DECISION MAKING STATEMENTS

DECISION MAKING STATEMENTS DECISION MAKING STATEMENTS If, else if, switch case These statements allow the execution of selective statements based on certain decision criteria. C language provides the following statements: if statement

More information

CS 3L (Clancy) Solutions and grading standards for exam 1

CS 3L (Clancy) Solutions and grading standards for exam 1 CS 3L (Clancy) Solutions and grading standards for exam 1 Fall 2009 *** DRAFT 177 students took the exam. We are still gathering statistics about the exam (mean and median). However, were you to receive

More information

Lecture Using ListBox and ComboBox Controls In Visual Basic 6: list box

Lecture Using ListBox and ComboBox Controls In Visual Basic 6: list box Lecture 10+11+12 7- Using ListBox and ComboBox Controls In 6: list box A list box displays a list of items from which the user can select one or more items. If the number of items exceeds the number that

More information

Control Structures. Outline. In Text: Chapter 8. Control structures Selection. Iteration. Gotos Guarded statements. One-way Two-way Multi-way

Control Structures. Outline. In Text: Chapter 8. Control structures Selection. Iteration. Gotos Guarded statements. One-way Two-way Multi-way Control Structures In Text: Chapter 8 1 Control structures Selection One-way Two-way Multi-way Iteration Counter-controlled Logically-controlled Gotos Guarded statements Outline Chapter 8: Control Structures

More information

Functions. Lab 4. Introduction: A function : is a collection of statements that are grouped together to perform an operation.

Functions. Lab 4. Introduction: A function : is a collection of statements that are grouped together to perform an operation. Lab 4 Functions Introduction: A function : is a collection of statements that are grouped together to perform an operation. The following is its format: type name ( parameter1, parameter2,...) { statements

More information

Chapter 8. Statement-Level Control Structures ISBN

Chapter 8. Statement-Level Control Structures ISBN Chapter 8 Statement-Level Control Structures ISBN 0-321-49362-1 Chapter 8 Topics Introduction Selection Statements Iterative Statements Unconditional Branching Guarded Commands Conclusions Copyright 2012

More information

LN #2 (3 Hrs) Variables, Sequence Boolean Logic & Selection CTPS Department of CSE,Coimbatore

LN #2 (3 Hrs) Variables, Sequence Boolean Logic & Selection CTPS Department of CSE,Coimbatore LN #2 (3 Hrs) Variables, Sequence Boolean Logic & Selection CTPS 2018 Objectives To understand variables and their values. To study the computational structure, form and functional elements for sequence

More information

Visual Basic. The Integrated Development Environment. Menu Bar

Visual Basic. The Integrated Development Environment. Menu Bar Visual Basic Visual Basic is initiated by using the Programs option > Microsoft Visual Basic 6.0 > Visual Basic 6.0. Clicking the Visual Basic icon, we can view a copyright screen enlisting the details

More information

Chapter Two: Program Design Process and Logic

Chapter Two: Program Design Process and Logic Chapter Two: Program Design Process and Logic 2.1 Chapter objectives Describe the steps involved in the programming process Understand how to use flowchart symbols and pseudocode statements Use a sentinel,

More information

Access VBA programming

Access VBA programming Access VBA programming TUTOR: Andy Sekiewicz MOODLE: http://moodle.city.ac.uk/ WEB: www.staff.city.ac.uk/~csathfc/acvba The DoCmd object The DoCmd object is used to code a lot of the bread and butter operations

More information

Parsing Instrument Data in Visual Basic

Parsing Instrument Data in Visual Basic Application Note 148 Parsing Instrument Data in Visual Basic Introduction Patrick Williams Instruments are notorious for sending back cryptic binary messages or strings containing a combination of header

More information

Making Decisions. C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies

Making Decisions. C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies 5 ec Making Decisions s C# Programming: From Problem Analysis to Program Design 2nd Edition David McDonald, Ph.D. Director of Emerging Technologies Chapter Objectives Learn about conditional expressions

More information