UNIT 4 Flashcards
covers everything that was taught in U4
U4L1 Evaluate
+
U4L1 Can you use the / operator to concatenate?
No, only the + operator to concatenate.
U4 L10
What will the statement show after running the code?
KEEP IN MIND: var changes at top of screen, which of the two are displayed?
It will display “School day”
sat -> mon, mon != sat or sun so “else”, “else”=weekday, weekday= SD
U4 L8
What part of the code do you use flowcharts for?
if else statements
U4 L8
STATEMENTS
what does the “if” statement do?
specifies a block of code
U4 L8
STATEMENTS
what does the “else” statement do?
if the same condition is false, it specifies the execution for a block of code
U4 L8
STATEMENTS
what does the “else if” statement do?
tests if the first condition is false
U4L2
how do “getText” and “getNumber” work?
grabs the text/number from the chosen line of code
getText (“locationDropdown”) ;
= gets text from locationDropdown
U4L3
how many times do you have to create variables and why?
once, can cause errors
U4L3
where should you keep your variables and why?
at the top of the program to stay organized
U4L3
should your variables be created inside or outside a function or onEvent?
outside
U4L11
if I want the screen to update as I type, in stead of “onEvent(“downButton”, “click”, function( ) {“ what should I write?
onEvent(“downButton”, “change”, function( ) {
U4L2
how do I get a users name input to show on the screen output
(ex: they’d type “Jassy” and Jassy would be shown somewhere on screen)
getText, (ex:
userName = “Hi, “ + getText(“nameInput”)+”!”;
)
U4L2
how do I get a value of a variable to increase or decrease? (ex: value goes up or down)
math (+-)
( ex: tempF = tempF + 1; )
U4L2
which programs should comments be used in and why?
every program, helps the debugging process