Programming Module Flashcards

(73 cards)

1
Q

What is binary

A

0s and 1s, 0 = Off, 1 = On

Simplifies data storage, and processing in computers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is hexadecimal

A

0-9 normal decimal

A = 10, B = 11, C = 12, D = 13, E = 14, F = 15

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is control structures

A

Guide the flow of program, ensuring logical execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is sequence in control structures

A

Code runs line by line, one after the other

Straightforward, step-by-step processes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is selection in control structures

A

Conditional statements (if, elif, else)

Decisions based on conditions

Choose paths based on criteria

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is iteration in control structures

A

Loops (for, while)

Execution of code repeatedly, based on given task

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is modular coding

A

Breaking down program into separate, manageable, sections into functions / modules

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the benefits of modular coding

A

Readability / Maintainability of code

Promotes code reusability, allows for easier debugging & testing

Allows for collaboration, as can assign members certain roles

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the best practices of modular coding

A

Use meaningful names: Name functions & variables clearly

Keep functions short: Each function should perform single task

Reuse functions: Use functions to avoid code duplication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are functions

A

Block of code designed to perform particular tasks

Reduces code that isn’t needed

def function_name (parameters):

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are parameters in functions

A

Variables listed in parentheses in function definition

Placeholders as values passed to function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are arguments in functions

A

Actual values / variables passed to functions when called

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is local scope in variables

A

Variables declared inside function

Accessible only within function

Use to prevent interference between functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is global scope in variables

A

Variables declared outside any function

Accessible throughout program

Minimise global variables, avoid unintentional modifications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are data types

A

Store & manipulate data

Essential for creating variables & constants in code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are integers

A

Whole number without decimal, efficient memory, fast processing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are floats

A

Number that includes decimal point

Requires more storage than integers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are strings

A

Sequence of characters enclosed in quotes, easy manipulation & concatenation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are booleans

A

Either true or false, enhances decision-making in code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is pseudocode

A

High-level representation of algorithms in a detailed yet readable description

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the investigation phase in the framework for development

A

Identify & Understand the problem

Specify what the software needs to do to solve the problem

Create a timeline for the development process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the design phase in the framework for development

A

Design data structures, how data will be organised, stored, accessed

Design and test algorithms that form software

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the evaluate phase in the framework for development

A

User Acceptance testing, ensure software meets needs and is user-friendly

Developer retrospective, development team reviews process, identifies success and areas for improvement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the develop phase in the framework for development

A

Develop & Debug the code, according to the designs in a programming language

Perform unit testing, to ensure individual components / functions of software work as intended

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is Validate Input Before Processing in good programming practices
Prevents errors, ensure game behaves as expected
26
What is Use Meaningful Variable Names in good programming practices
Enhances code debugging
27
What is Use of Constants for Readability and Maintenance in good programming practices
Makes easier to update values and understand the code
28
What is Use of Comments to Explain Code in good programming practices
Aid understanding, especially for complex logic
29
What is Appropriate Use of Standard Control Structures in good programing practices
Appropriate managing of the flow of a program
30
What is Use of Appropriate Indentation and White Space in good programming practices
Improves readability of code
31
What is One Logical Task Per Module in good programming practices
Simplifies code debugging, enhances code reuse
32
What is Meaningful Names For Modules in good programming practices
Simplifies code debugging, enhances code reuse
33
What is Exception Handling in good programming practices
Ensures game can gracefully handle errors without crashing
34
What is benefits of using structured algorithms
Ease of development Ease of understanding Ease of modification
35
What is Ease of Development in benefits of using structured algorithms
Allows for easy development of the algorithm
36
What is Ease of Understanding in benefits of using structured algorithms
Allows for understanding of the code
37
What is Ease of Modification in benefits of using structured algorithms
Allows for easy modification of algorithm
38
What is algorithm
Step-by-step procedure to solve a problem
39
What is a modular approach
Break down problems into smaller, manageable modules, enhances overall algorithm efficiency Ease of maintenance, code reusability, collaborative development
40
How do you develop modular code
Effective function design Parameter passing techniques Return values Collaborative coding sessions
41
What are structure charts as a design tool
Visual representation of system's hierarchical structure Breaks down system into component modules / subsystems
42
What is purpose of structure charts as a design tool
Modular design Clarity, provides clear overview of structure Communication tool among team members Maintenance, simplifies debugging & maintenance
43
What is good structure chart practices
Keep it simple Consistent naming Regular updates
44
What are the steps to creating a structure chart
Identify the major modules - Break down the modules into sub-modules Establish the calling relationships between modules Refine chart to improve clarity and efficiency
45
What is the use of stubs to represent incomplete modules
Placeholder code used to represent incomplete modules / functions Allows development to continue if certain parts of code not fully implemented Define function with correct name & parameters, but with simplified / dummy code
46
How do you load an array and print its contents
Loop through array using for loop Print every element
47
How do you add the contents of an array of numbers
Initialise a variable 'sum' while will hold the final value Loop through array using for loop Add the value of each element to 'sum' variable
48
How do you identify position of minimum or maximum value
Initialise two variables 'min' and 'max' which will hold the minimum and maximum values respectively Set the value of both to first element in array Loop through array using for loop If the element value is less then 'min', update the 'min' value to the element value If the element value is more than 'max', update the 'max' value to the element value
49
How do you open file for read, write, and append
Creates new file, truncates existing one "r" = Read (Process data), "w" = Write (Write to file), "a" = Append (Append to end of file) file = open("file.txt", "r") (Python) OPEN file.txt AS file (Pseudocode)
50
How do you write and append content to a file
Write method, overwrites existing content, writes single line to file Writelines method, writes multiple lines from list, appends lines to file Applies for both writing and appending
51
How do you close a file
Close file after to avoid resource leaks CLOSE filename (Pseudocode) filename.close() (Python)
52
What is testing all pathways through algorithm
Test data covers all possible paths within algorithm, complete coverage Eg. Algorithm with if-else, test data that triggers both the if & else parts
53
What is boundary condition testing
Focus on values above, below, or at upon which decisions are based
54
What is testing where the required answer is known
Test data for which output already known to verify correctness Ensure algorithm returns expected result for given input
55
What is type and range checking
Algorithm correctly handles different data types Algorithm operates within acceptable input range
56
What is desk checking
Manually walk through algorithm with test data Use trace tables
57
What are trace tables
Tracks value of variable at each step of algorithm's execution, flow of execution through program / algorithm Record each change in variable values and Boolean comparisons to each line of code executed. Clear visualisation of program's behaviour during execution
58
What are stepping through coded solutions
Executing a program one instruction or line at a time, sometimes with debugger Closely examine behaviour and track flow of execution Technique allows programmers to identify errors, understand complex logic, and observe changes in variable values and program state at each step
59
How do you use print statements to debug code
Help understand flow of execution, which sections have been executed State of variables at various points of program Be strategic about placement, remove / comment out unnecessary print statements afterwards
60
What are syntax errors
Source code of program contains mistakes, does not adhere to rules & grammar of programming language
61
What are runtime errors
Error during program running after being successfully compiled
62
What are logic errors
Bug in program that causes program to operator incorrectly, but doesn't terminate / crash program
63
What is an API
Set of rules & protocols that allow different software applications to communicate with each other. Specifies how software components should interact, what requests can be made, and what data will be returned
64
What is purpose of APIs
Acts as a bridge, allowing one piece of software to talk to another, regardless of underlying technology, allowing data exchange Reduces development time & costs by reusing existing services / components through integration, don't have to write from scratch Allows scaling of application by integrating third-party services Allows developers to update functionality of code, without changing application code that uses it
65
What are Limitations of APIs
Higher response times, API might be performing unnecessary calculations, using up needed resources May cause inefficient data transfer, and scalability issues Poor design makes it hard for developers to integrate it into their application
66
What does API stand for
Application Programming Interface
67
Example of an API can be used to integrate third-party services into an application
A food delivery platform that integrates with Google Maps to give user's visibily into their orders progress A weather app retrieves real-time data from the weather bureau to show you the weather in the weather app
68
Is ethical and legal implications in software development crucial
Yes
69
What is intellectual property (IP)
Legal rights granted to owners of software code, algorithms, other creations - Protect unique work of developers, ensure that they have control over their creations - Protected by copyrights, patents, trademarks
70
What is plagiarism & acknowledgement of code
Copying someone else's code without permission / proper acknowledgement Ethical practices require acknowledging use of someone else's IP Include comments in code / documentation to cite sources
71
What is australian copyright laws
Copyright protection automatic upon creation of work, doesn't require registration Developers must ensure they have right to use, modify, distribute software
72
What is software licensing
Grant permissions to users under specific conditions, detailing how software can be used, modified, distributed Proprietary Software Licences, Open Source Licences
73
What is software piracy
Unauthorised copying, distribution, or use of copyrighted software Fines, imprisonment, liability for damage