What do computers do?
What is declarative knowledge?
A statement of facts.
i.e. A student must pass 3 out of 5 mandatory assignments to qualify for the exam
What is imperative knowledge?
“How to…“/Recipe:
What is a fixed program computer?
A computer that will solve a specific mathematical problem but nothing else i.e. calculator
What is a stored program computer?
The computer stores and executes instructions (certain elements of the computer will execute the instructions in a specific sequence)
What are the three main parts in a basic machine architecture?
Memory
Control Unit
Arithmetic Logic Unit
What is a syntax?
The structure of statements in a computer language:
i.e. “hi” 5 not valid
but 3.2 * 5 is valid
What are semantics?
the meaniing of a syntactically correct string of symbols with no static semantic errors.
Caution: such strings only have one meaning in programming languages
What are different syntactic/semantic errors?
What is the difference between interpreted and compiled?
What is a (Python) Program?
What are data objects?
Name a few scalar objects?
int, float, bool, double, NoneType
What is an expression?
i.e. + (Sum), - (Difference), * (Product), / (Division), %(Remainder), ** (power of)
How do you bind variables and values?
Using the equal sign
pi = 3.14159
Why do you give names to values of expressions?
To reuse the names instead of computing the values every time you need them
i.e. pi = 3.14159
radius = 2.2
area = pi * (radius ** 2)
What happens if you change bindings?
2. Previous value may still be stored but you cannot access it anymore
What is a String?
How can you input something=
use the input function
–> value is by default always a string so you must cast with numbers when needed i.e. int(input(“Type a number…))