Paper 1 Revision (Not needed) Flashcards
What is a data type?
A data type defines the values that can be stored and the operations that can be performed on the data.
What is the description of the real/float data type?
The real/float data type represents positive or negative numbers that can have a fractional part.
What is the description of the boolean data type?
The boolean data type represents a value that can be either true or false.
What is the description of the character data type?
The character data type represents a single number, letter, or symbol.
What is the description of the string data type?
The string data type represents a collection of characters.
What is the description of the date/time data type?
The date/time data type represents a point in time and can have various formats.
What is the description of the pointer/reference data type?
The pointer/reference data type is used to store memory addresses
What is the description of the records data type?
The records data type represents a collection of fields, each with a potentially different data type, similar to a row in a table.
What is the description of the arrays data type?
The arrays data type represents a finite, indexed set of related elements, all having the same data type.
What are user-defined data types?
User-defined data types are created by deriving from existing data types to create customized data structures
How can user-defined data types be used?
User-defined data types can be used to create customized data structures, such as creating a “Customer” data type with attributes like Forename, Surname, and EmailAddress.
What is variable declaration?
Variable declaration is the process of creating a variable for the first time, giving it a name and sometimes a data type, and allocating memory for it.
What is constant declaration?
Constant declaration is similar to variable declaration but used for creating constants. The value of a constant does not change during program execution.
What is assignment?
Assignment is the process of giving a constant or variable a value.
What is iteration?
Iteration is the process of repeating a block of code. It can be definite (with a known number of repetitions) or indefinite (with an unknown number of repetitions).
What is definite iteration?
Definite iteration is a type of iteration where the number of repetitions required is known before the loop starts. Examples include for loops.
What is indefinite iteration?
Indefinite iteration is a type of iteration where the number of repetitions required is not known before the loop starts. Examples include while loops.
What are nested structures in programming?
Nested structures refer to placing one selection or iteration structure within another. It is identified by different levels of indentation in code.
Why is it important to use meaningful identifier names?
It is important to use meaningful identifier names for constants, variables, and subroutines to improve code readability and make it easier for others to understand the purpose of named objects in the program.
What does the rounding operation do?
The rounding operation limits the degree of accuracy of a number to a specified number of significant figures
What does the truncation operation do?
The truncation operation removes the decimal part of a number and returns only the whole part.
What does the NOT boolean operation do?
The NOT operation returns the opposite of a boolean value.
What does the AND boolean operation do?
The AND operation returns true if both boolean values are true.
What does the OR boolean operation do?
Answer: The OR operation returns true if at least one of the boolean values is true.
What does the XOR boolean operation do?
The XOR operation returns true if exactly one of the boolean values is true
What are constants in programming?
Constants are data items whose value does not change once assigned. They are used for
What are variables in programming?
Variables are data items whose value can change during program execution. They are used for storing data that can be modified as the program runs.
What does the length function do for strings?
The length function returns the number of characters in a specified string.
What does the position function do for strings?
The position function returns the position of a specified character within a string.
What does the concatenation operation do for strings?
The concatenation operation joins two or more strings together to form a new, longer string.
What does the string to integer conversion do?
The string to integer conversion converts a string to an integer data type.
What does the string to float conversion do?
The string to float conversion converts a string to a float data type
What does the integer to string conversion do?
The integer to string conversion converts an integer to a string data type.
What is random number generation in programming?
Random number generation is the ability of a programming language to generate pseudorandom numbers for various purposes.
What is exception handling in programming?
Exception handling is the process of dealing with errors or exceptions that occur during program execution to prevent crashes and inform users of errors.
What are subroutines in programming?
Subroutines are named blocks of code that contain instructions designed to perform a frequently used operation, reducing code repetition and improving code readability.
What are parameters in subroutines?
Parameters are pieces of information specified within brackets when calling a subroutine, used to pass data between subroutines.
How can values be returned from subroutines?
Subroutines can return values, and those that always return values are called functions. However, procedures can also return values.
What are local variables in subroutines?
Local variables are variables declared within a subroutine and can only be accessed within that subroutine. They exist in memory only during the execution of the subroutine.
What are global variables in programming?
Global variables can be accessed from any part of a program and exist in memory for the entire duration of the program’s execution
What is the role of stack frames in subroutine calls?
Stack frames are used to store return addresses, parameters, and local variables for each subroutine call during program execution.
What is nesting in subroutine calls?
Nesting occurs when one subroutine calls another, and each subroutine call is represented by a stack frame pushed onto the call stack.
How are stack frames used in subroutine calls?
Stack frames are used to store information during subroutine calls.
What happens to stack frames during nested subroutine calls?
During nested subroutine calls, stack frames are pushed onto the call stack and popped when the subroutines finish executing.
What happens when a subroutine completes its execution?
When a subroutine completes, its stack frame is popped from the call stack, and the computer returns to the previous subroutine using the stored return address, parameters, and local variables.
What does the call stack look like when all subroutines have completed their execution?
When all subroutines have completed, the call stack becomes empty.
What is the procedural programming paradigm?
The procedural programming paradigm involves writing programs as sequences of instructions executed in order. It utilizes procedures such as functions and subroutines that can be called from anywhere within the program
How is data stored in procedural programs?
Data is stored using constants and variables in procedural programs. Data structures can have a global scope accessible throughout the program or a local scope accessible only within the structure where they are declared
What is the structured approach in program design?
The structured approach uses four basic structures (assignment, sequence, selection, and iteration) to design and construct programs. It breaks down problems into smaller tasks, which are solved using procedures or modules that form part of the overall solution.
What are the benefits of designing a program from the top down?
Designing a program from the top down improves program maintainability by breaking down the solution into manageable elements. It facilitates easier navigation and debugging, especially in large projects.
How do object-oriented programs store data and instructions?
Object-oriented programs use objects as containers for both data and instructions. New objects are created from classes, and each object has unique property values while sharing identical methods with other objects of the same class
What is instantiation in object-oriented programming?
Objects are created from classes by subroutines called constructors.
What is a class in object-oriented programming?
A class is a blueprint for creating objects in object-oriented programming. It defines the properties (data) and methods (instructions) that objects of its type will have. Class definitions list the class name, properties, and methods.
What is the difference between private, public, protected in class definitions?
In class definitions,
* Private methods or properties can only be accessed from within the object.
* Public methods allow access to and modification of a class’s private properties.
* Protected methods can only be accessed in the same and subclasses
What is encapsulation in object-oriented programming?
Encapsulation is the process of combining methods and procedures to form an object. It allows objects to encapsulate their contents, including properties and methods.
What is function overloading in object oriented programming?
Overloading is a programming concept that allows programmers to define two or more functions with the same name and in the same scope.
What is inheritance in object-oriented programming?
Inheritance allows a class to inherit the properties and methods of another class while having its own properties and methods.
The inherited class is called the super-class or parent class, and the inheriting class is called the subclass or child class.
Program to interface, not implementation
Design principle allows unrelated classes to make use of similar methods.
An interface is defined as a collection of abstract procedures that can be implemented by unrelated classes
Why do we favour composition over inheritance?
Composition is seen as more flexible relationship between objects.
What is polymorphism in object-oriented programming?
Polymorphism is when objects can be handled in different ways depending on their class.
It allows objects of different classes to be used interchangeably if they have shared methods or properties. .
What is overriding in object-oriented programming?
Overriding is the process of providing a different implementation for a method that has the same name as a method in an inherited class.
It allows the subclass to customize or extend the behavior of the inherited method
What is association in object-oriented programming?
Association refers to the relationship between objects.
Association can be categorized as aggregation or composition
What is aggregation in object-oriented programming?
Aggregation represents a weaker association, where the associated object can exist independently.
Shown with an unfilled diamond-headed arrow.
——-◇
What is composition in object-oriented programming?
Composition represents a stronger association, where the associated object is destroyed when the containing object is destroyed.
Shown with a filled diamond-headed arrow.
—–◆
Why is object-oriented programming used?
Object-oriented programming provides a clear structure for developing and testing programs. It facilitates code reuse, and allows for collaborative development in large projects. Object-oriented programming enhances the efficiency and organization of code.
What are arrays?
Arrays are indexed sets of related elements that store data. They must be finite, indexed, and contain elements of the same data type.
How are elements accessed in an array?
Elements in an array are accessed using their index, which usually starts from zero.
Can arrays be multidimensional?
Yes, arrays can be created in multiple dimensions.
What are fields?
Fields are individual pieces of data
What are records?
Records are collections of fields
What are files?
Files are collections of records.
What is a queue?
A queue is an abstract data structure based on an array. It follows the “first in, first out” (FIFO) principle, where the first item added to the queue is the first one to be removed.