Programming Flashcards
What does execution mean?
The process by which a computer carries out the instructions of a computer.
What do algorithm consist of?
A sequence of unambiguous,step-by-step instructions.
What is a program an example of?
An algorithm that has been converted into program code so that it can be executed by a computer.
What should a well-written algorithm be?
Free of logical errors and easy to code in any high-level language.
Can you give 4 differences between an algorithm and program?
Command words in pseudo-code are written in capital letters,in python they’re written in lower case.
SET…TO(pseudo-code) is replaced in python by an =.
RECEIVE..FROM in pseudo-code is replaced in python by an’input’.
SEND..TO DISPLAY in pseudo-code command in python translates to’print’
What are the main similarities between algorithms and programs?
Both use descriptive variable names.
Indentation features in both.
The three programming constructs-sequence,selection and iteration(basic building blocks of both)
What are the three programming constructs?
Sequence,selection,and iteration
What is a syntax error?
An error that occurs when a rule of the programming language is broken.
What will happen if a piece of code isn’t right,for a computer?
It won’t be able to execute it and will flag a syntax error.
Why do algorithms use variables?
(named memory locations)to store values.
Why are variables important for computers?
They have a variety of uses ,for example controlling the number of times a loop is executed.
When algorithms are converted into programs the computer needs to be told what type of data is stored in each variable.
What are data types?
specifies what kind of data it can hold.
What are common data types?
Integer,real,Boolean and character
What does the data type of a value determine?
The operations that can be performed upon it.
What is an integer?
Used to store whole numbers without a fractional part.