Computer Science Exam 1 (questions
and detailed answers fully covered)
Algorithm - ANS -list of instructions to solve a problem
Program - ANS -list of instruction to perform a specific task the computer can execute
interperter - ANS -translates and executes a few lines of high level language code
Compiler - ANS -translates the entire program before it starts executing
How Python shell works - ANS -Reads the input
Evaluates
Prints
Syntax - ANS -Form (green on bottom red on top)
Semeatics - ANS -Meaning (green means go red means stop)
Values - ANS -fundamental things a program manipulates
ex: 1, 2.3, "University of Delaware"
Data types - ANS -Classification of values
int
, float`
String - ANS -A data type
enclosed in single, double quote characters
variables - ANS -name referring to a value
must start with letter or underscore
Operators - ANS -tokens that represent computations
Expression - ANS -A combination of variables, operators, and values that represents a single
result value.
Division using / - ANS -result type will be a float even if operands are ints
Division using // - ANS -result will always be rounded down and the type will be an int if all
operands are ints
Modulus Operator- if something is a multiple - ANS -varName % num
-evaluates to 0 if its a multiple
-evaluates to 1 -num-1 if its not a multiple
Modulus Operator- if something is even - ANS -varName % 2
-evaluates to 0 if even
-evaluates to 1 if not
Statement - ANS -instruction that a computer can execute
and detailed answers fully covered)
Algorithm - ANS -list of instructions to solve a problem
Program - ANS -list of instruction to perform a specific task the computer can execute
interperter - ANS -translates and executes a few lines of high level language code
Compiler - ANS -translates the entire program before it starts executing
How Python shell works - ANS -Reads the input
Evaluates
Prints
Syntax - ANS -Form (green on bottom red on top)
Semeatics - ANS -Meaning (green means go red means stop)
Values - ANS -fundamental things a program manipulates
ex: 1, 2.3, "University of Delaware"
Data types - ANS -Classification of values
int
, float`
String - ANS -A data type
enclosed in single, double quote characters
variables - ANS -name referring to a value
must start with letter or underscore
Operators - ANS -tokens that represent computations
Expression - ANS -A combination of variables, operators, and values that represents a single
result value.
Division using / - ANS -result type will be a float even if operands are ints
Division using // - ANS -result will always be rounded down and the type will be an int if all
operands are ints
Modulus Operator- if something is a multiple - ANS -varName % num
-evaluates to 0 if its a multiple
-evaluates to 1 -num-1 if its not a multiple
Modulus Operator- if something is even - ANS -varName % 2
-evaluates to 0 if even
-evaluates to 1 if not
Statement - ANS -instruction that a computer can execute