Class Notes (1,033,347)
US (405,808)
BC (3,856)
ISYS (68)
Lecture 11

ISYS2157 Lecture Notes - Lecture 11: Infinite Loop, Checkbox, Carriage ReturnPremium

3 pages20 viewsFall 2016

Department
Information Systems
Course Code
ISYS2157
Professor
James Gips
Lecture
11

Page:
of 3
Introduction to Programming
Lecture #11
9.21.16
Event handlers
oButton pressers
oText change
Speeding example
oCheckbox for construction
oInput speed limit
oButton press – event
Comments
Declarations
Inputs
Check inputs for error
Try catch and if statements – check and see if number is
reasonable
Calculations
Display results
Combine
oCheckbox – make false
Then check it in your program
Boolean
Textbox
oWord wrap – true
oMultiline – true
oRead only
oNo need for vertical scroll bars
Not all variable need to be declared at the top of the program
&
oConcatenation – joins two strings together
o+ Also does the same thing for concatenation
Dim S as String
S = “Boston” & “College”
S = S & “Eagles”
Boston College Eagles
Control structures
oHow control of a program/statement is dictated
Event handler
Sequencing
Try catch
IF, THEN, ELSE
Loops
find more resources at oneclass.com
find more resources at oneclass.com
Loops
oAllow you to do the same sequence of statements over and over again
ovbCRLF
Visual basic carriage return line feed
Same thing as enter
For Loop
oFor N = F to T
N – next
N = index variable
F = beginning value
T = ending value
Each line is produced by one time through the loop
Lecture #12
9.28.16
Do While Conditions
Statements
Loop
If true then go through the loop
Ex.
X = 2
DO while x<7
X=x+1
B = 2*x
Loop
2<7
X = 2 + 1
B = 2*3
Do the loop again until x<7 is false and not true
The loop must at some point be false otherwise it’ll be an infinite loop since it is
always true
Ex.
X = 2
Do while x<7
Y = 23
Loop
X<7; 2<7 will always be true so it continues through
Do Until Loop
Used to repeat a group of statement until it is true
LINES MATTER – go to new line for each one
Exit Statement
Allows you to exit a loop
oSome people really don’t like the exist statement
NPer Example
Have Amount, Rate, Goal
find more resources at oneclass.com
find more resources at oneclass.com
See how long it takes for the Amount you invest to get to the Goal at a given rate
oAmount must be less than Goal otherwise it won’t take any time to get to
the Goal
Debug Mode
Looking for errors
Release – ready to release program since found all the errors
Debug – Windows – Local
oTells you all of the values of the variables right now
oHelps find logical errors
find more resources at oneclass.com
find more resources at oneclass.com

Loved by over 2.2 million students

Over 90% improved by at least one letter grade.