Download presentation
Presentation is loading. Please wait.
Published byGary Barker Modified over 9 years ago
1
1 © 2000 John Urrutia. All rights reserved. Qbasic Input, Calculations and Functions
2
2 © 2000 John Urrutia. All rights reserved. The INPUT statement INPUT variable-list INPUT “prompt ” ; or, variable-list prompt – any valid string ; – Question mark generated , – No Question mark generated variable-list – mix and match separate with commas
3
3 © 2000 John Urrutia. All rights reserved. DATA & READ statements DATA const, const, const, … Provides internal storage Accessed sequentially READ var, var, var, … Populates variables from DATA RESTORE label Resets the some or all the DATA
4
4 © 2000 John Urrutia. All rights reserved. Calculations Order of operations (precedence) ^(Power) +, -(Unary) *, /, \, MOD, +, -(Arithmetic) , >=, <>, =(Relational) Boolean operators NOT, AND, OR, XOR, EQV, IMP
5
5 © 2000 John Urrutia. All rights reserved. Boolean Operators NOT– negation (bit-wise complement) AND– logical addition (conjunction) OR– logical subtraction (disjunction) XOR– exclusive “or” EQV– logical equivalence IMP– logical implication
6
6 © 2000 John Urrutia. All rights reserved. NOT Boolean Truth Tables Expr NOT FalseTrue FalseTrue
7
7 © 2000 John Urrutia. All rights reserved. AND Boolean Truth Tables Expr 1Expr 2 AND True FalseTrue False TrueFalse
8
8 © 2000 John Urrutia. All rights reserved. OR Boolean Truth Tables True FalseTrue FalseTrue False Expr 1Expr 2 OR
9
9 © 2000 John Urrutia. All rights reserved. XOR Boolean Truth Tables True False True FalseTrue False Expr 1Expr 2 XOR
10
10 © 2000 John Urrutia. All rights reserved. Arithmetic Operators * – Multiplication / – Division \ – Integer Division MOD – Modula (remainder) + – Addition - – Subtraction
11
11 © 2000 John Urrutia. All rights reserved. Functions A function is a set of instructions that perform a specific task. FunctionName (argument1, …) Built-in & User defined X$ = UCASE$(X$)
12
12 © 2000 John Urrutia. All rights reserved. Built-in Functions Mathematic SQR, EXP, LOG Trigonometric SIN, COS, TAN String RIGHT$, LEFT$, MID$
13
13 © 2000 John Urrutia. All rights reserved. Built-in Functions Conversions MKI$ - CVI, MKD$ - CVD CHR$ - ASC System DATE$ - TIME$
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.