References. Iteration For. Iteration (Repetition) Iteration While. For loop examples

Size: px
Start display at page:

Download "References. Iteration For. Iteration (Repetition) Iteration While. For loop examples"

Transcription

1 References ENGG1811 Computing for Engineers Week 7 Iteration; Sequential Algorithms; Strings and Built-in Functions Chapra (Part 2 of ENGG1811 Text) Topic 19 (chapter 12) Loops Topic 17 (section 10.1) Strings Topic 16 (section 9.2) Built-in Functions Assignment requirements will be explained at the 10am Wed lecture (see second-last slide). ENGG1811 UNSW, CRICOS Provider No: 00098G1 W7 slide 1 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 2 Iteration (Repetition) Very often need to execute repeatedly Loops are that can do this Process is called iteration Kinds of loop: For (iterate a fixed number of times) While (iterate as long as something is True) Do-Loop (general iteration) Iteration For For statement sets an integer loop variable to each value in a range and executes forming the loop body for each value: optional For intvar = start To finish Step amount Next intvar Loop body start and finish are expressions, evaluated once Step amount is optional (default 1) may use (but not change) the value of the loop variable loop must terminate (VBA checks consistency of start, finish and amount) ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 3 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 4 For loop examples ' 1. factorial (assume n is set beforehand) fact = 1 For i = 1 To n fact = fact * i Next i ' fact = n! ' 2. sum = sum of the first n squares (reverse order!) sum = 0 For k = n To 1 Step -1 sum = sum + k*k Next k ' 3. Compound interest without exponentiation ' (principal P, interest rate r (%), n years) balance = P For y = 1 To n balance = balance * (1.0 + r*0.01) Next y While statement continues to execute as long as a Boolean expression is True While boolean-expression Loop guard Loop body * Loop guard is evaluated If it is True execute the loop body and go back to start of loop to re-test the guard Otherwise (i.e., it is False) exit loop and continue with rest of program Loop body must change state so that loop guard can eventually become False (else infinite loop) * Why not End While? Beats me. Iteration While ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 5 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 6 1

2 Loop body must change state so that loop guard can eventually become False (else we have produced an infinite loop) Iteration termination MC Escher (1948) Handteckning [Drawing Hands]; lithograph While loop examples ' 1. largest power of 2 less than some limit (lim) pow2 = 1 While 2*pow2 <= lim pow2 = 2*pow2 ' 2. approximation to square root: k for any k >= 0 ' Algorithm: Newton-Raphson. For theory see Wikipedia or ' x 1 = x 0 f (x 0 ) / f '(x 0 ), where f (x) = x 2 k and thus f '(x) = 2x Dim x As Double ' current estimate Dim lastx As Double ' previous estimate x = k: lastx = 0 ' guesses While Abs(x lastx) > EPSILON lastx = x x = x - (x ^ 2 k) / (2 * x) ' x k Constant: tiny value representing acceptable error ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 7 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 8 Pseudocode and refinement Pseudocode and refinement How did we come up with the square root solution? Initial version is statement of purpose set x to within EPSILON of k using Newton-Raphson algorithm Express algorithm using English and VB control structures (If, While etc): pseudocode Indent subsidiary Refine to subprograms and VB set initial guess and last guess to suitable starting values While current guess and last guess are too far apart recalculate guess using N-R formula Refined pseudocode: remember to update the variable holding the last guess before updating the current guess; Also choose a safe value for the initial guesses set current guess (x) to k [or 1, k/100, any > EPSILON] set last guess (lastx) to 0 While the abs val of the difference is > EPSILON update lastx update x using the formula (when loop exits, x is an excellent approximation to k) Demo: use this loop in a subprogram to show convergence ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 9 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 10 Other kinds of loop Do-Loop statement is similar to While, but the loop body is always executed at least once: Do Loop body Loop While boolean-expression Loop guard Alternative form uses complemented guard: Do Loop Until boolean-expression Can terminate the loop early with the statement Exit Do (also Exit While and Exit For) Excel object model (simplified) VBA programs can interact with the data on a worksheet, create new sheets etc. Workbook, sheets, cells form a hierarchy of objects, manipulated like ordinary variables (can use and/or change) Simplest reference to cells is via top-level Application object: Application.ActiveCell Application.ActiveSheet.Cells(row,col) any integer expression for row and col row counts from 1 to 65535* col counts from 1 (= A) to 255* Can omit Application. Prefix * Excel accepts a wider range than this ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 11 ENGG1811 UNSW, CRICOS Provider No: 00098G W5 slide 12 2

3 Excel object model, cont. Each cell has a large number of attributes or properties, recording its contents and appearance. Most can be changed. Most important properties from our viewpoint are Value and Formula, the two attributes easily changed by the user Value is a variant (untyped value) Formula is a string (as it would appear in the formula bar) both can be assigned Worksheet Programming We can use values on the active worksheet as inputs to a program, and overwrite cells to show output and calculated values We can iterate over rows or columns of data We can detect empty cells to stop the iteration Example: running sum to the right of a column (defective subprogram over, to be corrected in the lecture) Developer Macros AddRunningSum ENGG1811 UNSW, CRICOS Provider No: 00098G W5 slide 13 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 14 Example: Running sum ' WARNING: contains a deliberate error Sub AddRunningSum() Dim row As Integer ' index always integral Dim col As Integer Dim sum As Double ' numeric values normally real row = 2: col = 1: sum = 0 ' FYI, the : symbol separates multiple simple While ActiveSheet.Cells(row, col).value <> "" sum = sum + ActiveSheet.Cells(row, col).value ActiveSheet.Cells(row, col+1).value = sum ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 15 Debugging Loops If a program fails to terminate, press Ctrl-Alt-Break (Break may be labelled Pause), or Esc in the labs VBA interpreter pauses, shows program state: current execution point Hover mouse over variable to show current value Is there a general principle you can apply to all loops? ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 16 Procedures Functions and Subprograms are together called procedures Functions return a single value, should not change program state Subprograms can change state by altering variables outside the procedure altering files outside the application communicating with other applications changing the values of arguments passed by reference (next slide) Function argument list enclosed in parentheses, subprogram arg list isn t unless you use the Call statement (more VB inconsistency ) Parameters revisited Values passed to procedures are called arguments Variables defined to hold these values are called parameters Parameters are local variables, like ones declared using Dim Data can be passed in two different ways: by value (argument is expression, only value transferred) by reference (argument is variable, parameter acts as a temporary alias) keywords ByVal and ByRef specify which (ByRef is assumed if omitted) ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 17 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 18 3

4 Reference Parameters Sub halve1(byval x As Double) x = x / 2 Sub halve2(byref x As Double) x = x / 2 y = 6.4: z = 6.4 halve1 y ' what is the value of y? halve2 z ' what is the value of z? The keyword ByRef (or none) passes a reference to the argument rather than its value. x becomes an alias for z and changes to x also affect z immediately. With ByVal, or if the argument is not a variable, x is an independent local variable initialised by the argument (6.4). Changing it has no effect outside the procedure. Example: Swapping values Sub Swap(ByRef x1 As Variant, ByRef x2 As Variant) Dim tmp As Variant tmp = x1 x1 = x2 x2 = tmp y = -23.5: z = 6 Swap y, z ' what are the values of y and z? We used the Variant type so the procedure can be used to exchange the contents of variables any type. This is the only recommended use for Variants. Unfortunately, the following does NOT work Swap ActiveSheet.Cells(1,1), ActiveCell Motivation: imagine exchanging the positions of an apple and an orange on the table in front of you. Now do it again using just one hand! ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 19 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 20 Named Arguments Sequential Algorithms For procedures with long argument lists (especially built-in procedures), arguments can be specified in any order using the notation paramname:=argument Example (see MsgBox Function in VBA Help) reply = MsgBox(title:="Bummer", _ returns integer value representing button pressed: vbcancel or vbretry prompt:="no solution to your equation", _ buttons:=vbcritical + vbcancelretry) parameter name underscore allows line break within statement built-in VBA constants assist readability VBA is particularly useful for tasks such as Processing rows or columns on one pass Locating cells with particular characteristics Identifying extreme values (max/min) These are called sequential tasks, because they treat the data as a sequence of items, usually stored in cells Standard sequential algorithms can be adapted to solve these kinds of problems ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 21 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 22 Simple Scans The simplest cases just process each element of a sequence in order (for convenience) Elements are independent End of sequence normally marked by empty cell Pseudocode: column scan set col to the required column number set row to the row where the sequence starts While ActiveSheet.Cells(row, col) is not empty apply required step to this cell move row one cell down State-based Scans Other cases accumulate history in variables during the scan Element order may or may not matter Variables need to be correctly initialised Examples: AddRunningSum, maximum or minimum calculation, run of equal values, merging ordered sequences, mode of an ordered sequence (you are not likely to need the last few). ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 23 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 24 4

5 Maximum/minimum Max/min calculations maintain a best so far variable May also need to know the position of the (first or last occurrence of) the maximum Pseudocode for maximum of a column: set col to the required column number set row to the row where the sequence starts set max to the value in that cell While ActiveSheet.Cells(row,col) is not empty If cell value is greater than max Then set max to cell value End If move row one cell down Maximum/minimum, continued If the problem is to highlight all extreme (max or min) values, need two passes First pass finds the extreme value (prev slide) Second pass processes each cell whose value matches the extreme value Next week we will see how cell appearance can be altered (more general than conditional formatting) Macro Recorder used to capture relevant code ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 25 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 26 Maximum/minimum, continued If the problem is to find min/max for only some cells, can t initialise from the first cell as usual use a Boolean variable to record whether a min/max has been found after the loop the variable tells you whether there was a min/max at all If you need to find out more than one piece of info about a list of values, consider whether you can perform multiple actions on a single pass example: min + max, or min/max + count etc Example: min of positive values only Problem: Find where the smallest positive value (if any) is in the column containing the active cell Pseudocode, first attempt set col to the column containing the active cell set row to the starting row set rowmin to zero ' = undefined minimum position While the cell at (row, col) contains a number If the cell value is positive Then If rowmin = 0 Or cell value < value at (rowmin, col) Then set rowmin to row ' now valid End If End If move row one cell down (Solution developed in lecture) ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 27 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 28 Strings Literal Strings A string is a sequence of characters Strings in VBA can be of virtually any length (including zero, of course) Components are characters represented internally as codes with numeric value from 0 to 255 each code is interpreted by an output device as a graphic character or special action functions Chr and Asc convert between character and numeric code String constants are enclosed in double-quote characters " " (not single quotes) How to include a double-quote as a member of the string (the delimiter-as-data problem)? Write it twice, as in "Reference: ""Excel for Experts""" Empty string is denoted by "" ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 29 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 30 5

6 String Operators & concatenates (joins) two strings "c" & "at" (= "cat") "cat" & "ch" & "-22" relational (comparison) operators compare individual characters, so "cat" < "dog" (because "c" < "d") "cat" < "cave" (because "t" < "v") "cat" < "catastrophe" (prefix) "Cat" < "cat" (case sensitive) can change to case-insensitive comparison (to make "Cat" = "cat") by placing Option Compare Text at the top of the module String Matching The Like operator allows a string expression to be tested against a pattern that includes wildcards strdata Like "pattern" The pattern consists of? any single character # any digit character * zero or more characters [list] any character in list [!list] any character not in list Important notation! Same notation as Access query partial match ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 31 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 32 String Matching Examples Assume the following values str1 = "cat": str2 = "Route66": str3 = "2*3" Expression Value Reason str1 Like "cat" True ordinary chars OK str1 Like "c?t" True? matches the character a str1 Like "c" False must match whole of string str2 Like "*##" True ends in two digits str2 Like "[A-Z]*" True [A-Z] matches any capital str2 Like "*[!6]" False can't match non-6 at end str2 Like "*[!6]*" True (you work it out!) str3 Like "*3" True * matches 2* str3 Like "#[*]?" True to match special chars * [? literally, enclose in [ ] ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 33 Select Case Multiway selection with a common expression: VBA has a simpler way than many If any number of each of these can occur Select Case expression Case value Case value 1, value 2 Case value 1 To value 2 Case Is > value Case Like pattern Case Else End Select evaluated first, then matched against each label single value multiple values grouped inclusive range of values open range of values values matching pattern all unmatched values ENGG1811 UNSW, CRICOS Provider No: 00098G W5 slide 34 Select Case example Classify a single-character string c Select Case UCase(c) Case "A","E","I","O","U" sym = "vowel" Case "0" To "9" sym = "digit" Case "A" To "Z" sym = "consonant" Case "" sym = "empty" Case Like "??*" sym = "more than one char" Case Else sym = "punctuation" End Select use of UCase saves repeating upper and lower case letter rules ' or Case Like "[A-Z]" Built-in Functions VBA includes a range of mathematical, string and conversion functions Accept one argument (sometimes other than one) and return exactly one value Mathematical functions include Sin, Cos, Tan, Atn (arctangent), all in radians Abs, Sgn, Int (largest int ), Fix (truncate towards 0), Round (to any number of decimal places, including neg) Sqr ( ), Exp (e x ), Log (ln x) Rnd (pseudo-random number) Look up Math Functions in VBE's Help ENGG1811 UNSW, CRICOS Provider No: 00098G W5 slide 35 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 36 6

7 Built-in Functions, cont. Can also use any* function available to worksheet formulas, using Application.WorksheetFunction.name(args ) Examples (Application. can be omitted): angle = WorksheetFunction.Radians(-90) payment = WorksheetFunction.PMT(rate, numperiods, _ curvalue) code = WorksheetFunction.Replace(text, start, 3, _ "***") Some expect Range objects (described in a later lecture) as their data sources Look up Worksheet Functions in VBE's Help * except if there s a direct equivalent in VBA, like Sin Function call Len(str) String and Character Functions Mid(str,start,len) Asc(str) Chr(code) LCase(str) Trim(str) Returns number of characters in str len-char substring of str, start; also Left(str,len) and Right(str,len) char code for first char in str Unit string containing char with code str with all upper-case chars converted to lower case (also UCase) str with spaces removed from both ends (also LTrim, RTrim) InStr(str,match) first position in str where match occurs, or 0 Replace(str,match,r epl) String(str,n) str with all occurrences of match replaced by repl (other args possible) n copies of first char of str ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 37 ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 38 Type Conversion Functions Format Function Can mix up numeric types (angle + intoffset is evaluated as Double) When explicit conversion is needed, use function: Function name Accepts as argument Returns CStr number String (also Format next slide) CLng number or string Long Integer (rounded if from Double) CDbl number or string Double Val string Integer or Double, ignores trailing junk Round(v,d) number v Rounded to d decimal places Hex integer Hexadecimal string form ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 39 Specialised formatting of numbers and dates Format(expr, fmt) returns a formatted string fmt mixes ordinary characters and formatting codes: Predefined code Displays 0 digit or zero # digit or nothing % percentage placeholder ( 100, show %) e+ e- E+ E- scientific single char or space < > force lower-case or upper-case ddd mmm yy hh nn date/time components (see text) Can also use predefined formats such as Scientific, Percent, Long Date etc. See VBE Help for details ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 40 12s2 Assignment 1 (ecas) Purpose: implement algorithms to avoid two aircraft colliding Framework sheet with simulation parameters (can be randomised) and results simulation module, calls your procedures ecas display mimics the real TCAS Tasks: four short functions and three longer subprograms (predict future positions, issue avoidance instructions, analyse incident) Required processes Make lots of objective decisions using Ifs in procedures (one subprog only:) process columns, read from/write to cells by name and by address, using layout Consts What you submit must be your own work, penalties apply Support and tools Test sheet for your four functions Comparison of your position prediction with ours Style assessor Forum (general questions), consultants (specific one-one help) Bonus-point challenges for more capable students Summary Reference parameters allow a subprogram to change the value of variables declared outside Use pseudocode to express algorithm prior to coding in VB Active sheet and its cells can be addressed directly Sequential algorithms process a row or column of data systematically Some algorithms accumulate values, others process cells locally and order-independently Strings store simple character sequences Built-in functions evaluate commonly-required quantities (string and numeric) Relatively complex tasks can usually be subdivided into easily managed subtasks and solutions combined ENGG1811 UNSW, CRICOS Provider No: 00098G W7 slide 42 7

ENGG1811 Computing for Engineers Week 7 Iteration; Sequential Algorithms; Strings and Built-in Functions

ENGG1811 Computing for Engineers Week 7 Iteration; Sequential Algorithms; Strings and Built-in Functions ENGG1811 Computing for Engineers Week 7 Iteration; Sequential Algorithms; Strings and Built-in Functions ENGG1811 UNSW, CRICOS Provider No: 00098G1 W7 slide 1 References Chapra (Part 2 of ENGG1811 Text)

More information

References. Iteration For. Iteration (Repetition) Iteration While. For loop examples

References. Iteration For. Iteration (Repetition) Iteration While. For loop examples ENGG1811 UNSW, CRICOS Provider No: 00098G W6 slide 1 References ENGG1811 Computing for Engineers Week 6 Iteration; Sequential Algorithms; Strings and Built-in Functions Chapra (Part 2 of ENGG1811 Text)

More information

References. Iteration For. Iteration (Repetition) Iteration While. For loop examples

References. Iteration For. Iteration (Repetition) Iteration While. For loop examples References ENGG1811 Computing for Engineers Week 7 Iteration; Sequential Algorithms; Strings and Built-in Functions Chapra (Part 2 of ENGG1811 Text) Topic 19 (chapter 12) Loops Topic 17 (section 10.1)

More information

ENGG1811 Computing for Engineers Week 6 Iteration; Sequential Algorithms; Processing Cells

ENGG1811 Computing for Engineers Week 6 Iteration; Sequential Algorithms; Processing Cells ENGG1811 Computing for Engineers Week 6 Iteration; Sequential Algorithms; Processing Cells ENGG1811 UNSW, CRICOS Provider No: 00098G1 W6 slide 1 Why loops in programming? Let us hear from Mark Zuckerberg

More information

Position at 3pm. 2-3pm: Moved 50km North. Position at 2pm. Sum3 captures the regular pattern of Sum2 in a new statement, For.

Position at 3pm. 2-3pm: Moved 50km North. Position at 2pm. Sum3 captures the regular pattern of Sum2 in a new statement, For. Dead Reckoning ENGG1811 Computing for Engineers Week 6 Iteration; Sequential Algorithms; Processing Cells Dead reckoning is a navigation technique which computes the current position from The last known

More information

References. Parameters revisited. Reference Parameters. Example: Swapping values. Named Arguments

References. Parameters revisited. Reference Parameters. Example: Swapping values. Named Arguments References ENGG1811 Computing for Engineers Week 8 Objects and Collections; Using the Macro Recorder; Shapes Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder ENGG1811 UNSW, CRICOS Provider

More information

ENGG1811 Computing for Engineers Week 5 Control Structures for Programming: Selection, Functions

ENGG1811 Computing for Engineers Week 5 Control Structures for Programming: Selection, Functions ENGG1811 Computing for Engineers Week 5 Control Structures for Programming: Selection, Functions ENGG1811 UNSW, CRICOS Provider No: 00098G W5 slide 1 The Story So Far You should have some understanding

More information

References. Parameters revisited. Reference Parameters. Example: Swapping values. Named Arguments

References. Parameters revisited. Reference Parameters. Example: Swapping values. Named Arguments References ENGG1811 Computing for Engineers Week 7 Objects and Collections; Using the Macro Recorder; Shapes Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder ENGG1811 UNSW, CRICOS Provider

More information

The University of New South Wales SAMPLE Final Examination. November 2008 ENGG1811 Computing for Engineers

The University of New South Wales SAMPLE Final Examination. November 2008 ENGG1811 Computing for Engineers Family Name: Given Names: Student Number: Signature: The University of New South Wales SAMPLE Final Examination November 2008 ENGG1811 Computing for Engineers Time allowed: 2 hours Total number of questions:

More information

Language Fundamentals

Language Fundamentals Language Fundamentals VBA Concepts Sept. 2013 CEE 3804 Faculty Language Fundamentals 1. Statements 2. Data Types 3. Variables and Constants 4. Functions 5. Subroutines Data Types 1. Numeric Integer Long

More information

This Week. Trapezoidal Rule, theory. Warmup Example: Numeric Integration. Trapezoidal Rule, pseudocode. Trapezoidal Rule, implementation

This Week. Trapezoidal Rule, theory. Warmup Example: Numeric Integration. Trapezoidal Rule, pseudocode. Trapezoidal Rule, implementation This Week ENGG8 Computing for Engineers Week 9 Recursion, External Application Interfacing Monday: numeric integration example, then first part of the material Wednesday 9am: rest of the new material Wednesday

More information

VBA Handout. References, tutorials, books. Code basics. Conditional statements. Dim myvar As <Type >

VBA Handout. References, tutorials, books. Code basics. Conditional statements. Dim myvar As <Type > VBA Handout References, tutorials, books Excel and VBA tutorials Excel VBA Made Easy (Book) Excel 2013 Power Programming with VBA (online library reference) VBA for Modelers (Book on Amazon) Code basics

More information

Outline. Midterm Review. Using Excel. Midterm Review: Excel Basics. Using VBA. Sample Exam Question. Midterm Review April 4, 2014

Outline. Midterm Review. Using Excel. Midterm Review: Excel Basics. Using VBA. Sample Exam Question. Midterm Review April 4, 2014 Midterm Review Larry Caretto Mechanical Engineering 209 Computer Programming for Mechanical Engineers April 4, 2017 Outline Excel spreadsheet basics Use of VBA functions and subs Declaring/using variables

More information

Phụ lục 2. Bởi: Khoa CNTT ĐHSP KT Hưng Yên. Returns the absolute value of a number.

Phụ lục 2. Bởi: Khoa CNTT ĐHSP KT Hưng Yên. Returns the absolute value of a number. Phụ lục 2 Bởi: Khoa CNTT ĐHSP KT Hưng Yên Language Element Abs Function Array Function Asc Function Atn Function CBool Function CByte Function CCur Function CDate Function CDbl Function Chr Function CInt

More information

Outline. Data and Operations. Data Types. Integral Types

Outline. Data and Operations. Data Types. Integral Types Outline Data and Operations Data Types Arithmetic Operations Strings Variables Declaration Statements Named Constant Assignment Statements Intrinsic (Built-in) Functions Data and Operations Data and Operations

More information

Python allows variables to hold string values, just like any other type (Boolean, int, float). So, the following assignment statements are valid:

Python allows variables to hold string values, just like any other type (Boolean, int, float). So, the following assignment statements are valid: 1 STRINGS Objectives: How text data is internally represented as a string Accessing individual characters by a positive or negative index String slices Operations on strings: concatenation, comparison,

More information

ENGG1811 Computing for Engineers Week 10 Recursion, External Application Interfacing

ENGG1811 Computing for Engineers Week 10 Recursion, External Application Interfacing ENGG1811 Computing for Engineers Week 10 Recursion, External Application Interfacing ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 1 This Week Wednesday am: Will include discussion about assignment

More information

St. Benedict s High School. Computing Science. Software Design & Development. (Part 1 Computer Programming) National 5

St. Benedict s High School. Computing Science. Software Design & Development. (Part 1 Computer Programming) National 5 Computing Science Software Design & Development (Part 1 Computer Programming) National 5 VARIABLES & DATA TYPES Variables provide temporary storage for information that will be needed while a program is

More information

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */ Overview Language Basics This chapter describes the basic elements of Rexx. It discusses the simple components that make up the language. These include script structure, elements of the language, operators,

More information

1. Introduction to Microsoft Excel

1. Introduction to Microsoft Excel 1. Introduction to Microsoft Excel A spreadsheet is an online version of an accountant's worksheet, which can automatically do most of the calculating for you. You can do budgets, analyze data, or generate

More information

ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder. Examples

ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder. Examples References ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder Week 8 Objects and Collections; Using the Macro Recorder; Shapes ENGG1811 VBA Reference

More information

STATS 507 Data Analysis in Python. Lecture 2: Functions, Conditionals, Recursion and Iteration

STATS 507 Data Analysis in Python. Lecture 2: Functions, Conditionals, Recursion and Iteration STATS 507 Data Analysis in Python Lecture 2: Functions, Conditionals, Recursion and Iteration Functions in Python We ve already seen examples of functions: e.g., type()and print() Function calls take the

More information

DOWNLOAD PDF MICROSOFT EXCEL ALL FORMULAS LIST WITH EXAMPLES

DOWNLOAD PDF MICROSOFT EXCEL ALL FORMULAS LIST WITH EXAMPLES Chapter 1 : Examples of commonly used formulas - Office Support A collection of useful Excel formulas for sums and counts, dates and times, text manipularion, conditional formatting, percentages, Excel

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

Higher Computing Science Software Design and Development - Programming Summary Notes

Higher Computing Science Software Design and Development - Programming Summary Notes Higher Computing Science Software Design and Development - Programming Summary Notes Design notations A design notation is the method we use to write down our program design. Pseudocode is written using

More information

Chapter 5. Repetition. Contents. Introduction. Three Types of Program Control. Two Types of Repetition. Three Syntax Structures for Looping in C++

Chapter 5. Repetition. Contents. Introduction. Three Types of Program Control. Two Types of Repetition. Three Syntax Structures for Looping in C++ Repetition Contents 1 Repetition 1.1 Introduction 1.2 Three Types of Program Control Chapter 5 Introduction 1.3 Two Types of Repetition 1.4 Three Structures for Looping in C++ 1.5 The while Control Structure

More information

References. Notices Week 5. A Note on the Textbook. Algorithms and programs. Context

References. Notices Week 5. A Note on the Textbook. Algorithms and programs. Context ENGG1811 Computing for Engineers Week 5 Introduction to Programming and Visual Basic for Applications References Chapra (std text Part 2), Topics 8, 9 (Chapters 1, 2). Some of this week s material is derived

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

UNIT- 3 Introduction to C++

UNIT- 3 Introduction to C++ UNIT- 3 Introduction to C++ C++ Character Sets: Letters A-Z, a-z Digits 0-9 Special Symbols Space + - * / ^ \ ( ) [ ] =!= . $, ; : %! &? _ # = @ White Spaces Blank spaces, horizontal tab, carriage

More information

Function Exit Function End Function bold End Function Exit Function

Function Exit Function End Function bold End Function Exit Function The UDF syntax: Function name [(arguments) [As type] ] [As type] [statements] [name = expression] [Exit Function] [statements] [name = expression] - name the name of the function - arguments a list of

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

CHAPTER 4: MICROSOFT OFFICE: EXCEL 2010

CHAPTER 4: MICROSOFT OFFICE: EXCEL 2010 CHAPTER 4: MICROSOFT OFFICE: EXCEL 2010 Quick Summary A workbook an Excel document that stores data contains one or more pages called a worksheet. A worksheet or spreadsheet is stored in a workbook, and

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 04 Programs with IO and Loop We will now discuss the module 2,

More information

Macro Programming Reference Guide. Copyright 2005 Scott Martinez

Macro Programming Reference Guide. Copyright 2005 Scott Martinez Macro Programming Reference Guide Copyright 2005 Scott Martinez Section 1. Section 2. Section 3. Section 4. Section 5. Section 6. Section 7. What is macro programming What are Variables What are Expressions

More information

Long (or LONGMATH ) floating-point (or integer) variables (length up to 1 million, limited by machine memory, range: approx. ±10 1,000,000.

Long (or LONGMATH ) floating-point (or integer) variables (length up to 1 million, limited by machine memory, range: approx. ±10 1,000,000. QuickCalc User Guide. Number Representation, Assignment, and Conversion Variables Constants Usage Double (or DOUBLE ) floating-point variables (approx. 16 significant digits, range: approx. ±10 308 The

More information

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 05 I/O statements Printf, Scanf Simple

More information

COMP1730/COMP6730 Programming for Scientists. Data: Values, types and expressions.

COMP1730/COMP6730 Programming for Scientists. Data: Values, types and expressions. COMP1730/COMP6730 Programming for Scientists Data: Values, types and expressions. Lecture outline * Data and data types. * Expressions: computing values. * Variables: remembering values. What is data?

More information

Unit-II Programming and Problem Solving (BE1/4 CSE-2)

Unit-II Programming and Problem Solving (BE1/4 CSE-2) Unit-II Programming and Problem Solving (BE1/4 CSE-2) Problem Solving: Algorithm: It is a part of the plan for the computer program. An algorithm is an effective procedure for solving a problem in a finite

More information

Introduction to: Computers & Programming: Review prior to 1 st Midterm

Introduction to: Computers & Programming: Review prior to 1 st Midterm Introduction to: Computers & Programming: Review prior to 1 st Midterm Adam Meyers New York University Summary Some Procedural Matters Summary of what you need to Know For the Test and To Go Further in

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

ENGG1811 Computing for Engineers Week 1 Introduction to Programming and Python

ENGG1811 Computing for Engineers Week 1 Introduction to Programming and Python ENGG1811 Computing for Engineers Week 1 Introduction to Programming and Python ENGG1811 UNSW, CRICOS Provider No: 00098G W4 Computers have changed engineering http://www.noendexport.com/en/contents/48/410.html

More information

STUDENT LESSON A12 Iterations

STUDENT LESSON A12 Iterations STUDENT LESSON A12 Iterations Java Curriculum for AP Computer Science, Student Lesson A12 1 STUDENT LESSON A12 Iterations INTRODUCTION: Solving problems on a computer very often requires a repetition of

More information

Functions. Lecture 6 COP 3014 Spring February 11, 2018

Functions. Lecture 6 COP 3014 Spring February 11, 2018 Functions Lecture 6 COP 3014 Spring 2018 February 11, 2018 Functions A function is a reusable portion of a program, sometimes called a procedure or subroutine. Like a mini-program (or subprogram) in its

More information

Long (LONGMATH) variables may be used the same as short variables. The syntax is the same. A few limitations apply (see below).

Long (LONGMATH) variables may be used the same as short variables. The syntax is the same. A few limitations apply (see below). Working with Long Numbers. Long Variables Constants You define a long variable with the LONG statement, which works similar to the DIM statement. You can define long variables and dimension long variable

More information

EnableBasic. The Enable Basic language. Modified by Admin on Sep 13, Parent page: Scripting Languages

EnableBasic. The Enable Basic language. Modified by Admin on Sep 13, Parent page: Scripting Languages EnableBasic Old Content - visit altium.com/documentation Modified by Admin on Sep 13, 2017 Parent page: Scripting Languages This Enable Basic Reference provides an overview of the structure of scripts

More information

Lecture 2 FORTRAN Basics. Lubna Ahmed

Lecture 2 FORTRAN Basics. Lubna Ahmed Lecture 2 FORTRAN Basics Lubna Ahmed 1 Fortran basics Data types Constants Variables Identifiers Arithmetic expression Intrinsic functions Input-output 2 Program layout PROGRAM program name IMPLICIT NONE

More information

VISUAL BASIC 6.0 OVERVIEW

VISUAL BASIC 6.0 OVERVIEW VISUAL BASIC 6.0 OVERVIEW GENERAL CONCEPTS Visual Basic is a visual programming language. You create forms and controls by drawing on the screen rather than by coding as in traditional languages. Visual

More information

Civil Engineering Computation

Civil Engineering Computation Civil Engineering Computation First Steps in VBA Homework Evaluation 2 1 Homework Evaluation 3 Based on this rubric, you may resubmit Homework 1 and Homework 2 (along with today s homework) by next Monday

More information

بسم اهلل الرمحن الرحيم

بسم اهلل الرمحن الرحيم بسم اهلل الرمحن الرحيم Fundamentals of Programming C Session # 10 By: Saeed Haratian Fall 2015 Outlines Examples Using the for Statement switch Multiple-Selection Statement do while Repetition Statement

More information

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs.

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. Lesson 2 VARIABLES Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. WHAT ARE VARIABLES? When you input data (i.e. information) into a computer

More information

C++ Programming: From Problem Analysis to Program Design, Third Edition

C++ Programming: From Problem Analysis to Program Design, Third Edition C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 2: Basic Elements of C++ Objectives (continued) Become familiar with the use of increment and decrement operators Examine

More information

ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder. Examples

ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder. Examples References ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder Week 8 Objects and Collections; Using the Macro Recorder; Shapes Note: there is very limited

More information

VBA Collections A Group of Similar Objects that Share Common Properties, Methods and

VBA Collections A Group of Similar Objects that Share Common Properties, Methods and VBA AND MACROS VBA is a major division of the stand-alone Visual Basic programming language. It is integrated into Microsoft Office applications. It is the macro language of Microsoft Office Suite. Previously

More information

Strings in Visual Basic. Words, Phrases, and Spaces

Strings in Visual Basic. Words, Phrases, and Spaces Strings in Visual Basic Words, Phrases, and Spaces Strings are a series of characters. Constant strings never change and are indicated by double quotes. Examples: Fleeb Here is a string. Strings are a

More information

5. Control Statements

5. Control Statements 5. Control Statements This section of the course will introduce you to the major control statements in C++. These control statements are used to specify the branching in an algorithm/recipe. Control statements

More information

Using Custom Number Formats

Using Custom Number Formats APPENDIX B Using Custom Number Formats Although Excel provides a good variety of built-in number formats, you may find that none of these suits your needs. This appendix describes how to create custom

More information

ENGG1811 Computing for Engineers Week 9 Dialogues and Forms Numerical Integration

ENGG1811 Computing for Engineers Week 9 Dialogues and Forms Numerical Integration ENGG1811 Computing for Engineers Week 9 Dialogues and Forms Numerical Integration ENGG1811 UNSW, CRICOS Provider No: 00098G W9 slide 1 References & Info Chapra (Part 2 of ENGG1811 Text) Topic 21 (chapter

More information

Active Planner. How to Create and Use Database Query Formulas

Active Planner. How to Create and Use Database Query Formulas Active Planner How to Create and Use Database Query Formulas Table of Contents Introduction... 1 Database Query Part 1 - The Basics... 2 Database Query Part 2 Excel as the Data source... 12 Database Query

More information

More Flow Control Functions in C++ CS 16: Solving Problems with Computers I Lecture #4

More Flow Control Functions in C++ CS 16: Solving Problems with Computers I Lecture #4 More Flow Control Functions in C++ CS 16: Solving Problems with Computers I Lecture #4 Ziad Matni Dept. of Computer Science, UCSB Administrative CHANGED T.A. OFFICE/OPEN LAB HOURS! Thursday, 10 AM 12 PM

More information

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing SECTION 1: INTRODUCTION ENGR 112 Introduction to Engineering Computing 2 Course Overview What is Programming? 3 Programming The implementation of algorithms in a particular computer programming language

More information

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines. Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

Slide 1 CS 170 Java Programming 1 The Switch Duration: 00:00:46 Advance mode: Auto

Slide 1 CS 170 Java Programming 1 The Switch Duration: 00:00:46 Advance mode: Auto CS 170 Java Programming 1 The Switch Slide 1 CS 170 Java Programming 1 The Switch Duration: 00:00:46 Menu-Style Code With ladder-style if-else else-if, you might sometimes find yourself writing menu-style

More information

SWITCH(DatePart("w",DateOfYear) IN(1,7),"Weekend",DatePart("w",DateOfYear) IN(2,3,4,5,6),"Weekday") AS DayType,

SWITCH(DatePart(w,DateOfYear) IN(1,7),Weekend,DatePart(w,DateOfYear) IN(2,3,4,5,6),Weekday) AS DayType, SeQueL 4 Queries and their Hidden Functions! by Clark Anderson A friend recently exclaimed Can you really use this function in SQL! In this article of my series I will explore and demonstrate many of the

More information

LESSON 5 FUNDAMENTAL DATA TYPES. char short int long unsigned char unsigned short unsigned unsigned long

LESSON 5 FUNDAMENTAL DATA TYPES. char short int long unsigned char unsigned short unsigned unsigned long LESSON 5 ARITHMETIC DATA PROCESSING The arithmetic data types are the fundamental data types of the C language. They are called "arithmetic" because operations such as addition and multiplication can be

More information

Functions in Excel. Structure of a function: Basic Mathematical Functions. Arithmetic operators: Comparison Operators:

Functions in Excel. Structure of a function: Basic Mathematical Functions. Arithmetic operators: Comparison Operators: Page1 Functions in Excel Formulas (functions) are equations that perform calculations on values in your spreadsheet. A formula always starts with an equal sign (=). Example: =5+2*7 This formula multiples

More information

variables programming statements

variables programming statements 1 VB PROGRAMMERS GUIDE LESSON 1 File: VbGuideL1.doc Date Started: May 24, 2002 Last Update: Dec 27, 2002 ISBN: 0-9730824-9-6 Version: 0.0 INTRODUCTION TO VB PROGRAMMING VB stands for Visual Basic. Visual

More information

Numerical Methods in Scientific Computation

Numerical Methods in Scientific Computation Numerical Methods in Scientific Computation Programming and Software Introduction to error analysis 1 Packages vs. Programming Packages MATLAB Excel Mathematica Maple Packages do the work for you Most

More information

LSP 121. LSP 121 Math and Tech Literacy II. Topics. Loops. Loops. Loops

LSP 121. LSP 121 Math and Tech Literacy II. Topics. Loops. Loops. Loops LSP 121 Math and Tech Literacy II Greg Brewster DePaul University Topics The FOR loop Repeats a set of statements a fixed number of times The WHILE loop Repeats a set of statements until a condition is

More information

IFA/QFN VBA Tutorial Notes prepared by Keith Wong

IFA/QFN VBA Tutorial Notes prepared by Keith Wong IFA/QFN VBA Tutorial Notes prepared by Keith Wong Chapter 5: Excel Object Model 5-1: Object Browser The Excel Object Model contains thousands of pre-defined classes and constants. You can view them through

More information

Types and Expressions. Chapter 3

Types and Expressions. Chapter 3 Types and Expressions Chapter 3 Chapter Contents 3.1 Introductory Example: Einstein's Equation 3.2 Primitive Types and Reference Types 3.3 Numeric Types and Expressions 3.4 Assignment Expressions 3.5 Java's

More information

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Table of Contents Introduction!... 1 Part 1: Entering Data!... 2 1.a: Typing!... 2 1.b: Editing

More information

lab MS Excel 2010 active cell

lab MS Excel 2010 active cell MS Excel is an example of a spreadsheet, a branch of software meant for performing different kinds of calculations, numeric data analysis and presentation, statistical operations and forecasts. The main

More information

Agenda & Reading. VB.NET Programming. Data Types. COMPSCI 280 S1 Applications Programming. Programming Fundamentals

Agenda & Reading. VB.NET Programming. Data Types. COMPSCI 280 S1 Applications Programming. Programming Fundamentals Agenda & Reading COMPSCI 80 S Applications Programming Programming Fundamentals Data s Agenda: Data s Value s Reference s Constants Literals Enumerations Conversions Implicitly Explicitly Boxing and unboxing

More information

Visual Basic for Applications

Visual Basic for Applications Visual Basic for Applications Programming Damiano SOMENZI School of Economics and Management Advanced Computer Skills damiano.somenzi@unibz.it Week 1 Outline 1 Visual Basic for Applications Programming

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #43 Multidimensional Arrays In this video will look at multi-dimensional arrays. (Refer Slide Time: 00:03) In

More information

Course Outline. Introduction to java

Course Outline. Introduction to java Course Outline 1. Introduction to OO programming 2. Language Basics Syntax and Semantics 3. Algorithms, stepwise refinements. 4. Quiz/Assignment ( 5. Repetitions (for loops) 6. Writing simple classes 7.

More information

Object oriented programming. Instructor: Masoud Asghari Web page: Ch: 3

Object oriented programming. Instructor: Masoud Asghari Web page:   Ch: 3 Object oriented programming Instructor: Masoud Asghari Web page: http://www.masses.ir/lectures/oops2017sut Ch: 3 1 In this slide We follow: https://docs.oracle.com/javase/tutorial/index.html Trail: Learning

More information

LECTURE 0: Introduction and Background

LECTURE 0: Introduction and Background 1 LECTURE 0: Introduction and Background September 10, 2012 1 Computational science The role of computational science has become increasingly significant during the last few decades. It has become the

More information

Chapter 3. More Flow of Control. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Chapter 3. More Flow of Control. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 More Flow of Control Overview 3.1 Using Boolean Expressions 3.2 Multiway Branches 3.3 More about C++ Loop Statements 3.4 Designing Loops Slide 3-3 Flow Of Control Flow of control refers to the

More information

FANF. programming language. written by Konstantin Dimitrov. Revision 0.1 February Programming language FANF 1 / 21

FANF. programming language. written by Konstantin Dimitrov. Revision 0.1 February Programming language FANF 1 / 21 programming language FANF written by Konstantin Dimitrov Revision 0.1 February 2014 For comments and suggestions: knivd@me.com Programming language FANF 1 / 21 Table of Contents 1. Introduction...3 2.

More information

d2vbaref.doc Page 1 of 22 05/11/02 14:21

d2vbaref.doc Page 1 of 22 05/11/02 14:21 Database Design 2 1. VBA or Macros?... 2 1.1 Advantages of VBA:... 2 1.2 When to use macros... 3 1.3 From here...... 3 2. A simple event procedure... 4 2.1 The code explained... 4 2.2 How does the error

More information

A Fast Review of C Essentials Part I

A Fast Review of C Essentials Part I A Fast Review of C Essentials Part I Structural Programming by Z. Cihan TAYSI Outline Program development C Essentials Functions Variables & constants Names Formatting Comments Preprocessor Data types

More information

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013 DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013 GETTING STARTED PAGE 02 Prerequisites What You Will Learn MORE TASKS IN MICROSOFT EXCEL PAGE 03 Cutting, Copying, and Pasting Data Basic Formulas Filling Data

More information

Using Basic Formulas 4

Using Basic Formulas 4 Using Basic Formulas 4 LESSON SKILL MATRIX Skills Exam Objective Objective Number Understanding and Displaying Formulas Display formulas. 1.4.8 Using Cell References in Formulas Insert references. 4.1.1

More information

Arrays Structured data Arrays What is an array?

Arrays Structured data Arrays What is an array? The contents of this Supporting Material document have been prepared from the Eight units of study texts for the course M150: Date, Computing and Information, produced by The Open University, UK. Copyright

More information

egrapher Language Reference Manual

egrapher Language Reference Manual egrapher Language Reference Manual Long Long: ll3078@columbia.edu Xinli Jia: xj2191@columbia.edu Jiefu Ying: jy2799@columbia.edu Linnan Wang: lw2645@columbia.edu Darren Chen: dsc2155@columbia.edu 1. Introduction

More information

Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex

Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex Basic Topics: Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex Review ribbon terminology such as tabs, groups and commands Navigate a worksheet, workbook, and multiple workbooks Prepare

More information

Maciej Sobieraj. Lecture 1

Maciej Sobieraj. Lecture 1 Maciej Sobieraj Lecture 1 Outline 1. Introduction to computer programming 2. Advanced flow control and data aggregates Your first program First we need to define our expectations for the program. They

More information

Microsoft Excel 2010 Handout

Microsoft Excel 2010 Handout Microsoft Excel 2010 Handout Excel is an electronic spreadsheet program you can use to enter and organize data, and perform a wide variety of number crunching tasks. Excel helps you organize and track

More information

CSI33 Data Structures

CSI33 Data Structures Outline Department of Mathematics and Computer Science Bronx Community College October 24, 2018 Outline Outline 1 Chapter 8: A C++ Introduction For Python Programmers Expressions and Operator Precedence

More information

March 28, Excel Essentials. Jim Snediker. Suzi Huisman

March 28, Excel Essentials. Jim Snediker. Suzi Huisman March 28, 2019 Excel Essentials Jim Snediker Suzi Huisman 1 What is a Spreadsheet? A spreadsheet is the computer equivalent of a paper ledger sheet. Worksheet new name for Spreadsheet Workbook one file

More information

Computer Programming

Computer Programming Computer Programming Introduction Marius Minea marius@cs.upt.ro http://cs.upt.ro/ marius/curs/cp/ 26 September 2017 Course goals Learn programming fundamentals no prior knowledge needed for those who know,

More information

L4X v2.0 Reference. (v December 2008) David Fowle

L4X v2.0 Reference. (v December 2008) David Fowle L4X v2.0 Reference (v2.0.0.4-01 December 2008) http://www.pdfing.com/l4x 2 L4X v2.0 Reference Table of Contents Foreword Part I L4X Language Summary. 1 1 Importing... Strings of Text. 1 2 Importing...

More information

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals:

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals: Numeric Types There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals: 1-123 +456 2. Long integers, of unlimited

More information

Microsoft Office Excel Use Excel s functions. Tutorial 2 Working With Formulas and Functions

Microsoft Office Excel Use Excel s functions. Tutorial 2 Working With Formulas and Functions Microsoft Office Excel 2003 Tutorial 2 Working With Formulas and Functions 1 Use Excel s functions You can easily calculate the sum of a large number of cells by using a function. A function is a predefined,

More information

Programming Language 2 (PL2)

Programming Language 2 (PL2) Programming Language 2 (PL2) 337.1.1 - Explain rules for constructing various variable types of language 337.1.2 Identify the use of arithmetical and logical operators 337.1.3 Explain the rules of language

More information

Chapter 1. Math review. 1.1 Some sets

Chapter 1. Math review. 1.1 Some sets Chapter 1 Math review This book assumes that you understood precalculus when you took it. So you used to know how to do things like factoring polynomials, solving high school geometry problems, using trigonometric

More information

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan Lecture 08-1 Programming in C++ PART 1 By Assistant Professor Dr. Ali Kattan 1 The Conditional Operator The conditional operator is similar to the if..else statement but has a shorter format. This is useful

More information

C++ Basics. Lecture 2 COP 3014 Spring January 8, 2018

C++ Basics. Lecture 2 COP 3014 Spring January 8, 2018 C++ Basics Lecture 2 COP 3014 Spring 2018 January 8, 2018 Structure of a C++ Program Sequence of statements, typically grouped into functions. function: a subprogram. a section of a program performing

More information

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials Fundamentals We build up instructions from three types of materials Constants Expressions Fundamentals Constants are just that, they are values that don t change as our macros are executing Fundamentals

More information