Programming Flashcards
What is a program?
way of encoding algorithm in a precise enough way for computers to understand the instructions
What do high level programming languages do?
enable us to write program that are portable across different machines – they are closer to human languages
ie. Snap, Scratch, Python, C++, Java, Racket
What does a compiler/interpreter do?
takes a high level language and translates it into something that looks about the same, regardless of which high level language is used
What does an assembler do?
translates from Assembly language to Machine Code
What is an Assembly language?
specific to a particular computer architecture and operating system
What is machine code?
consists of binary or hexadecimal instructions that a computer can respond to directly
What is an algorithm?
precise, systematic method for producing a specified result
What are the 3 components of an algorithm?
sequencing
selection
iteration
What is sequencing?
instructions are executed in the specified order – order matters
- programs will execute exactly in the order that’s given
- if we assign values to variables, they’ll set one value after another, after another
What is a mutation?
updating variables, changing oneself (a step)
What is selection?
allows algorithm to select which instructions to execute depending on conditions
‘if ____, then ____’
‘if ____, then ____, else ____’
‘if [possibility], then you can ____, otherwise, you must ____’
What is iteration?
allows algorithm to repeat instructions
- loop: allows you to do the same thing over and over again, sometimes without a stopping condition, sometimes forever
‘repeat’
‘repeat until…’
‘repeat forever’
What are variables?
named storage location for data (named quantities – name + value)
Communication in Snap!
What is a broadcast?
sprites can send messages to each other
What is iterative design?
engaging in a continuous cycle (design → prototype → evaluate) until you have satisfied user specification
Be able to trace through code.
-
Describe what a block of Snap! does in English.
-
How do you describe a block of Snap! code in English?
- describe code in terms of input and output, and what is being done
use phrases:
- the block consumes…
- it does…
- it produces/displays/reports…
What is a bug?
error or flaw in software that makes it produce wrong or unexpected results
What is debugging?
process of finding and fixing bugs
- some bugs can allow ‘black hat hacker’ to gain control of computer
What are the 3 types of errors that can occur in software?
logical error
syntax error
semantic error
What is logical error?
fail to initialize variable, or there’s an ‘off by one’ error – main type
What is a syntax error?
incorrectly typed
What is a semantic error?
flaw in your understanding of the question