Subroutines and Structured Programming

0.0(0)
studied byStudied by 4 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/23

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

24 Terms

1
New cards

Subroutine

A named 'out of line' block of code that can be executed by simply writing its name in a program statement.

2
New cards

Procedures

Subroutines that perform actions but do not return a value.

3
New cards

Functions

Subroutines that perform actions and return a value.

4
New cards

Code Reusability

Writing code once and using it multiple times without rewriting.

5
New cards

Modularity

Breaking programs into manageable sections where each subroutine performs a specific task.

6
New cards

Simplified Maintenance

Easier updating and fixing of code with changes in a subroutine affecting all calls to it.

7
New cards

Improved Readability

Making code more organized and understandable by giving structure and clarity.

8
New cards

Enhanced Collaboration

Allowing different programmers to work on different subroutines simultaneously, particularly useful in large projects.

9
New cards

Parameters

Variables listed as part of a subroutine's definition to pass data into the subroutine.

10
New cards

By Value

Passing a copy of the data to the subroutine.

11
New cards

By Reference

Passing a reference to the actual data, allowing modifications.

12
New cards

Returning a Value

Subroutines can return a value to the calling routine using the return statement.

13
New cards

Local Variables

Variables declared within a subroutine, accessible only within that subroutine.

14
New cards

Encapsulation

Keeping variables confined to the subroutine to prevent interference with other parts of the program.

15
New cards

Memory Management

Local variables are automatically destroyed when the subroutine finishes execution.

16
New cards

Structured Approach

A method of programming that emphasizes breaking a program into smaller, manageable, and reusable modules or subroutines.

17
New cards

Modularization

Dividing the program into distinct subroutines.

18
New cards

Clear Interfaces

Using parameters and return values to define clear inputs and outputs for subroutines.

19
New cards

Documentation

Well-documented code with comments and clear variable names.

20
New cards

Improved Code Organization

Making large programs easier to understand and manage through a structured approach.

21
New cards

Enhanced Debugging and Testing

Easier testing of individual modules for improved debugging.

22
New cards

Facilitates Teamwork

Enabling different team members to work on separate modules simultaneously.

23
New cards

Scalability

Simplifying the process of adding new features or making changes.

24
New cards

Reuse of Code

Reusing subroutines in different parts of the program or in different programs.