Mod 9 Day 2 Flashcards
(27 cards)
What kind of program does a script require to change the source code into machine code
Interpreter
True or false, unlike an interpreter the compiler reads one line of code parses and understands the code converts it into machine code and executes the line of code
False
An interpreter ensures that a single line of source code is in the correct syntax and translates it into machine code
True
a compiler ensures that every line of the source code is correct syntax translates all of it into machine code and executes all the instructions
False
In object-oriented programming an object is known as the blueprint of a class and it does not exist until initiated by the programmer
False
The following scripting languages use objects. Choose all that apply A. Bash B. HTML C. Python D. PowerShell
B
C
D
Which of the following are General types of decision statements: A. If B. For C. Foreach D.while
A
B
C
D
Choose all that apply. Which of the following are General types of looping statements A. If B. For C. Foreach D. While
A
B
C
D
Choose all that apply. The loop can stop in interation or exit early using the following statements: A. Break B. Continue C. Return D. All of the above
A
B
Which of the following statements are true?
A. Variables do not need to be declared before use
B. Variables can be used after declaring them
C. Variables never have a data type
D. All programming languages have the data type of an integer
B
Choose all that apply. typically in an interpreted language to declare a variable you need to supply which of the following pieces of information. A. An identifier / name B. A data type C. An initial value D. An assignment operator
A
B
C
This is a variable that contains multiple values often of different data types
Array
These structures are made up of branching and looping statements which determine which sections of code executes and how many times specific code segments execute
Flow control
There are three basic scripting components what are they
Sequential action
Repetition structure
Branching structure
A linear progression of tasks such as input, output, and computation
Sequential action
This allows a script to choose which series of instructions to execute. Using the keyword IF a computer makes a decision using a Boolean expression on whether or not certain instructions execute
Branching
These structures cause a script to execute a set of actions multiple times like branching statements Loops use Boolean conditions to determine if it’s code block should execute some keywords for Loops are while and for.
Repetition structures
If the resulting Boolean condition returns a True Value the script executes the body of the loop. This is done for duration not an amount.
While statement
Often called a counting Loop because iterates through a sequence of numbers. This is done for a known quantity, it counts, and sets number of interations.
For statement
Specifies the instructions a computer is to perform and is written using interpreted programming languages
Script source code
Terminate the current Loop and immediately continue with the next statement after the newly terminated loop body
Break
Terminate the current Loop iteration and immediately execute the next iteration of the loop without completing the current iteration
Continue
These store information that can be easily referenced and manipulated in a script and provide a way of labeling a type of data with a descriptive name so scripts are easily understood by the reader
Variables
Define where a variable is accessible and how long its value is available
Variable scope