H446 Section 11 Programming Techniques

studied byStudied by 2 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions
Get a hint
Hint

Algorithm

1 / 60

61 Terms

1

Algorithm

A step-by-step procedure or formula for solving a problem or completing a task, often used in programming and computer science. Has inputs, processing and outputs that can be implemented in various programming languages.

New cards
2

Pseudocode

A high-level description of an algorithm that uses the structural conventions of programming languages but is intended for human reading rather than machine execution.

New cards
3

Comments

Annotations in code that explain or clarify the code's purpose and have no effect on the running of the program.

New cards
4

Arithmetic operations

Mathematical calculations such as addition, subtraction, multiplication, and division performed on numerical values in programming.

New cards
5

Round function

A built-in function that rounds a numerical value to the nearest integer or specified decimal place.

New cards
6

Modulus function

A mathematical operation that returns the remainder of a division between two numbers, commonly represented by the percent symbol (%) in programming.

New cards
7

Concatenate

To join two or more strings together to form a single string, often using the plus sign (+) in programming.

New cards
8

Variable

A symbolic name associated with a value that can change during program execution, used to store data.

New cards
9

Constant

A value that cannot be changed during the execution of a program, often used to store fixed data such as mathematical constants or configuration settings.

New cards
10

Name conventions

A set of rules and guidelines for naming variables and other identifiers in programming to enhance readability and maintainability. These conventions often include rules on capitalization, length, and character usage, for example variable names in Python are commonly written in lowercase and cannot start with a number or underscore.

New cards
11

Selection

A programming construct that allows the execution of certain code blocks based on specific conditions, often implemented using if-else statements or switch-case statements.

New cards
12

Sequence

A programming concept where instructions are executed in a linear order, one after another, from top to bottom, ensuring a clear flow of execution.

New cards
13

Relational operators

Operators that compare values, returning true or false based on conditions, such as equal to, greater than, or less than.

New cards
14

Switch/case

A control structure in programming that allows the execution of different code blocks based on the value of a variable or expression, providing an alternative to multiple if-else statements. Implemented as match-case in Python.

New cards
15

Iteration

A programming technique that repeatedly executes a block of code as long as a specified condition is true, often implemented using loops such as for and while.

New cards
16

Repeat … until

A loop that always executes at least once with the condition checked at the end of the loop.

New cards
17

While … end while

A control flow statement that repeatedly executes a block of code as long as a specified condition at the start evaluates to true, ending when the condition becomes false.

New cards
18

For … next

A loop that iterates over a sequence or range, executing a block of code for each value until the sequence is exhausted.

New cards
19

Nested loop

A loop that contains one or more loops within it, allowing for multiple levels of iteration over data structures.

New cards
20

Subroutine

A block of code designed to perform a specific task, which can be called and executed from different parts of a program, promoting code reuse and organization.

New cards
21

Function

A reusable named block of code that performs a specific task, which can be called with different arguments to produce varying results. Returns a value to the program that called it.

New cards
22

Procedure

A set of instructions that perform a specific task, similar to a function but may not return a value. Procedures are used to execute a sequence of statements in a program.

New cards
23

Passing parameters by value

A method of passing arguments to a subroutine where a copy of the actual parameter's value is made. This means that changes to the parameter within the subroutine do not affect the original variable.

New cards
24

Passing parameters by reference

A method of passing arguments to a subroutine where a reference to the actual parameter is passed instead of a copy. This allows changes made to the parameter within the subroutine to affect the original variable.

New cards
25

Global variable

A variable that is declared outside of any function or procedure and is accessible from any part of the program. Global variables retain their value across function calls.

New cards
26

Local variable

A variable that is declared within a subroutine or block and is only accessible within that scope. Local variables are created when the subroutine is called and destroyed when it exits.

New cards
27

Modular programming

A programming paradigm that emphasizes separating a program into distinct modules, each with its own functionality. This approach enhances code organization, reusability, and maintainability.

New cards
28

Recursion

A programming technique where a function calls itself to solve a problem. Recursion is often used to break down complex problems into simpler subproblems.

New cards
29

Base case

The condition under which a recursive function stops calling itself, preventing infinite recursion and allowing the function to return a value.

New cards
30

Benefits of recursion

Recursion can simplify code, making it easier to read and maintain. It also allows for elegant solutions to problems that can be divided into smaller, similar subproblems.

New cards
31

Drawbacks of recursion

Recursion can lead to increased memory usage and stack overflow errors if not managed properly. Additionally, it may result in slower performance compared to iterative solutions for some problems. Can be harder to trace through.

New cards
32

Call stack

A data structure that stores information about the active subroutines of a computer program, including the function calls and local variables. It plays a crucial role in managing function calls, especially in recursive programming.

New cards
33

Stack frame

A data structure within the call stack that holds information about the active subroutines or functions of a program, including local variables and return addresses, during the execution of a program.

New cards
34

Integrated Development Environment

A software application that provides comprehensive facilities to computer programmers for software development, including a code editor, debugger, and build automation tools.

New cards
35

IDE tools

Various features within an Integrated Development Environment (IDE) that assist programmers in writing, testing, and debugging code more efficiently. These tools may include syntax highlighting, code completion, version control integration, debugging tools and automated testing features.

New cards
36

Purpose of testing

To ensure software quality and functionality by identifying and fixing defects before deployment.

New cards
37

Normal data

Data that falls within the expected range of values and is used to test the typical operation of a system.

New cards
38

Boundary data

Data that tests the limits of input ranges, often at the edges of valid input values.

New cards
39

Erroneous data

Data that is invalid or outside the expected range, used to test how a system handles incorrect input.

New cards
40

Dry run

A manual execution of a program or algorithm using sample data to verify its correctness and logic without actual execution on a computer.

New cards
41

Procedural program

A type of programming that follows a sequence of commands or instructions, organizing code into procedures or functions to perform tasks.

New cards
42

Object Oriented Program

A programming paradigm that uses "objects" to represent data and methods, allowing for encapsulation, inheritance, and polymorphism to enhance code reusability and organization.

New cards
43

Attribute

A characteristic or property of an object in object-oriented programming that defines its state or behavior.

New cards
44

State

A condition or situation that an object can be in, often represented by its attributes or properties in object-oriented programming.

New cards
45

Behaviour

The actions or methods that an object can perform in object-oriented programming, often defined by its functions and interacting with its attributes.

New cards
46

Class

A blueprint or template for creating objects in object-oriented programming, defining attributes and behaviors that the created objects will have.

New cards
47

Constructor

A special method in a class that is called when an object is instantiated. It initializes the object's attributes and sets up its initial state.

New cards
48

Instantiate

To create a specific instance of a class, allocating memory for the object's attributes and initializing them through the constructor.

New cards
49

Private

An access modifier in object-oriented programming that restricts access to class members, making them accessible only within the class itself.

New cards
50

Public

A keyword in object-oriented programming that allows class members to be accessible from any other class or object. Public members can be freely accessed and modified.

New cards
51

Information hiding

A programming principle that restricts direct access to an object's data and implementation details, promoting encapsulation and reducing dependencies between components.

New cards
52

Variable Reference Diagram

In OOP , a visual representation that shows the relationships between variables, objects, and their references in memory, helping to understand how data is accessed and manipulated.

New cards
53

Getter

is a method that retrieves the value of a private variable from a class, allowing controlled access to the data while maintaining encapsulation.

New cards
54

Setter

A method used in object-oriented programming to set or update the value of an object's attribute, often providing a way to enforce validation or other logic during the assignment.

New cards
55

Encapsulation

The principle of bundling data and methods that operate on that data within a single unit or class, restricting direct access to some of the object's components to protect the integrity of the data.

New cards
56

Inheritance

A fundamental concept in object-oriented programming where a new class derives properties and behaviors from an existing class, promoting code reuse and establishing a hierarchical relationship.

New cards
57

Superclass

A class that is extended or inherited by one or more subclasses, providing shared attributes and methods to its derived classes.

New cards
58

Subclass

A class that is derived from another class, known as the superclass, inheriting its attributes and methods while potentially adding new features or overriding existing ones.

New cards
59

Polymorphism

The ability in object-oriented programming for different classes to be treated as instances of the same class through a common interface, allowing methods to be used interchangeably.

New cards
60

Overriding

The process by which a subclass provides a specific implementation of a method that is already defined in its superclass, allowing the subclass to customize or change the behavior of that method.

New cards
61
New cards
robot