programming structure Flashcards
What is a Variable (2)
-A variable is the name of a memory location that holds data during program execution.
-Most Programming languages require the programmer to declare all variables by listing their names and their data type.
What is syntax (2)
-Syntax refers to the set of rules that defines the format of the structure of each type of program instruction.
-All languages have a rule governing how statements should be structured.
What is an Algorithm (1)
An algorithm is a set of rules or steps that represent the solution to a problem.
What is a Sequence(1)
Several instructions are executed in the order in which they are listed one after the other. Can contain any number of actions and none can be omitted.
What is a Selection(1)
Statements may not be executed in the order in which they are listed. Statements are to be executed on a condition. They can be implemented using IF…THEN…ELSE statements.
What is iteration (1)
Iteration means repetition, so iterative statements always involve performing a loop in a program to repeat several statements. Several loops exist.
What is Repetition(1)
It’s normal that once a solution to a problem is created, we may wish to use this solution over nad over again for different sets of data.
What is a for loop?
The instructions inside the loop are executed a set number of times, controlled by a loop counter. An initial value, final value, and increment are specified. Each time the loop is executed, the loop counter is incremented.
What is a While loop?
The number of times the loop is to be carried out is not known in advance but is controlled by boolean variables.
What’s an Until loop?
Repetition continues until the condition is true.
What is a translation?
Code written in a high-level language can be read and understood by humans and requires translation so that the computer can execute the commands in the program.
What do translators consist of?(3)
ASSEMBLER translates assembly language into machine code.
INTERPRETER translates source code one line at a time. The processors executed a line of code before proceeding to translate the next line of code.
A COMPILER will attempt to convert the whole program into machine code before executing it.
What are the properties of object orientation?
It contains code that facilitates reading AND writing within an object.
What are the methods of object orientation?
Inheritance allows new classes to inherit attributes and behaviors from existing classes. This promotes code reuse and facilitates the creation of specialized classes based on more general ones.