Week 1 Flashcards
What’s an algorithm?
A step-by-step instruction that needs to be followed to solve a problem
What are the characterstics of an algorithm?
- Algorithms can have zero or more inputs
NOTE: If there is no input, then the expected outcome should generally always be the same - Algorithms ALWAYS have an output
- They need to be clear and concise - start, end and steps should be clearly specified
- They should be feasible (effective/efficient) - algorithms should not have redundant steps which makes them inefficient
- Finitness - algorithms should have an end point; cannot be infinite
- Language independent - NOT dependent on a specfic programming language
What are low-level languages?
Languages that communicate directly to the computer, either VERY close to computer language OR the same
There are two main types:
- Machine language (LOWEST LEVEL, SAME AS COMPUTER LANGUAGE)
- Assembly language (ONE LEVEL ABOVE MACHINE LANGUAGE, VERY CLOSE TO COMPUTER LANGUAGE)
What are the features of a program?
- Sequence - The instructions in a program are executed sequentially
- Repitition - The steps in programs can be looped/iterated
- Selection - Can designate what the steps and input will do for the program
What is machine language?
What are its characteristics?
Low-level language that relies on a binary format.
It is OS dependent, CANNOT BE USED BY ANY OS, and NOT readable by humans.
What is assembly language?
A more readable version of machine language. Still a low level language that directly communicates with hardware.
OS independent, can be read by humans.
What are high level languages?
What are their characteristics?
These are languages that are closer to human languages than machine language. They are machine/OS independent.
Requires a compiler OR interpreter.
What does a compiler do?
Translates the whole file in one step from high level language to machine language
Errors presented at the end of compilation process, continues to run until file is compiled
What is an interpreter?
Translates high level languages by translating one instruction at a time
Interpretation stop immediately if error is spotted
What is a program?
A program is a sequence of intstructions that specifies how to perform a computation to the computer.
Is compilation iterative, batch, interactive or none?
Batch.
Not iterative and not interactive.
Batch processing is executing the several processing jobs in a group without any user interaction. The complaining process scan and translate the entire program at once.
What are the key components of a program?
Input
Output
Operations
Control Structures
What do operations encompass?
They include arithmetic and logic operations
What do control structures encompass?
They include loops and conditions (true/false)