C173 Scripting and Programming Foundations Questions with Complete Solutions 100%
Solved| Grade A+
object-oriented programming A programming language model organized around objects
rather than "actions" and data rather than logic. Now each object contains its own data and its
own logic, and they communicate between themselves.
interpreted programming A programming language for which most of its implementations
execute instructions directly, without previously compiling a program into machine-language
instructions.
function In programming, this is a named section of a program that performs a specific task.
It only executes when invoked, and returns a value.
return <value> Specifies the value to be returned by a function back to its function call
def <Name>(<Parameters>): Defines a function in Python.
terminal A value that cannot be broken down further. Once you get to a terminal there is
nothing else you can replace it with. In programming grammar, these never appear on the left
side of a rule.
non-terminal A value that can be reduced further by the grammar rules until it is reduced to
a terminal value.
cost (time,memory) depends on the input.
worst case When analysing programs it's the worst-case execution time that is important.
The worst-case execution time is the time it takes for the case where the input for a given size
takes the longest to run
, Making lookup Faster hash function. Given a keyword, the hash function will tell you where
to look in the index. It will map the keyword to a numbe
Expression → Expression Operator Expression Expression → Expression Operator Expression
Logical Operators 1. NOT is evaluated first
2. AND is evaluated next
3. OR is evaluated last
NOT Evaluator The Logical NOT Operator is used to reverse the logical state of its operand.
For example, if a condition is evaluated to false then the Logical NOT operator will make the
answer true. Here are a few examples:
not True → False
not False → True
not (True and False) → True
not (True or False) → False
AND Evaluator When work with AND evaluator, if the first expression evaluates to false,
then the second expression is ignored and the entire statement evaluates to false. Here are a
few examples:
false AND true → false
Solved| Grade A+
object-oriented programming A programming language model organized around objects
rather than "actions" and data rather than logic. Now each object contains its own data and its
own logic, and they communicate between themselves.
interpreted programming A programming language for which most of its implementations
execute instructions directly, without previously compiling a program into machine-language
instructions.
function In programming, this is a named section of a program that performs a specific task.
It only executes when invoked, and returns a value.
return <value> Specifies the value to be returned by a function back to its function call
def <Name>(<Parameters>): Defines a function in Python.
terminal A value that cannot be broken down further. Once you get to a terminal there is
nothing else you can replace it with. In programming grammar, these never appear on the left
side of a rule.
non-terminal A value that can be reduced further by the grammar rules until it is reduced to
a terminal value.
cost (time,memory) depends on the input.
worst case When analysing programs it's the worst-case execution time that is important.
The worst-case execution time is the time it takes for the case where the input for a given size
takes the longest to run
, Making lookup Faster hash function. Given a keyword, the hash function will tell you where
to look in the index. It will map the keyword to a numbe
Expression → Expression Operator Expression Expression → Expression Operator Expression
Logical Operators 1. NOT is evaluated first
2. AND is evaluated next
3. OR is evaluated last
NOT Evaluator The Logical NOT Operator is used to reverse the logical state of its operand.
For example, if a condition is evaluated to false then the Logical NOT operator will make the
answer true. Here are a few examples:
not True → False
not False → True
not (True and False) → True
not (True or False) → False
AND Evaluator When work with AND evaluator, if the first expression evaluates to false,
then the second expression is ignored and the entire statement evaluates to false. Here are a
few examples:
false AND true → false