Programming Module Flashcards

You may prefer our related Brainscape-certified flashcards:
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

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

Whare 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
Q

What is Validate Input Before Processing in good programming practices

A

Prevents errors, ensure game behaves as expected

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

What is Use Meaningful Variable Names in good programming practices

A

Enhances code debugging

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

What is Use of Constants for Readability and Maintenance in good programming practices

A

Makes easier to update values and understand the code

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

What is Use of Comments to Explain Code in good programming practices

A

Aid understanding, especially for complex logic

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

What is Appropriate Use of Standard Control Structures in good programing practices

A

Appropriate managing of the flow of a program

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

What is Use of Appropriate Indentation and White Space in good programming practices

A

Improves readability of code

31
Q

What is One Logical Task Per Module in good programming practices

A

Simplifies code debugging, enhances code reuse

32
Q

What is Meaningful Names For Modules in good programming practices

A

Simplifies code debugging, enhances code reuse

33
Q

What is Exception Handling in good programming practices

A

Ensures game can gracefully handle errors without crashing

34
Q

What is benefits of using structured algorithms

A

Ease of development

Ease of understanding

Ease of modification

35
Q

What is Ease of Development in benefits of using structured algorithms

A

Allows for easy development of the algorithm

36
Q

What is Ease of Understanding in benefits of using structured algorithms

A

Allows for understanding of the code

37
Q

What is Ease of Modification in benefits of using structured algorithms

A

Allows for easy modification of algorithm

38
Q

What is algorithm

A

Step-by-step procedure to slove a problem

39
Q

What is a modular approach

A

Break down problems into smaller, manageable modules, enhances overall algorithm efficiency

Ease of maintenance, code reusability, collaborative development

40
Q

How do you develop modular code

A

Effective function design

Parameter passing techniques

Return values

Collaborative coding sessions

41
Q

What are structure charts as a design tool

A

Visual representation of system’s hierarchical structure

Breaks down system into component modules / subsystems

42
Q

What is purpose of structure charts as a design tool

A

Modular design

Clarity, provides clear overview of structure

Communication tool among team members

Maintenance, simplifies debugging & maintenance

43
Q

What is good structure chart practices

A

Keep it simple

Consistent naming

Regular updates

44
Q

What is the use of stubs to represent incomplete modules

A

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

45
Q

How do you load an array and print its contents

A

Loop through array using for loop

Print every element

46
Q

How do you add the contents of an array of numbers

A

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

47
Q

How do you identify position of minimum or maximum value

A

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

48
Q

How do you open file for read, write, and append

A

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)

49
Q

How do you write and append content to a file

A

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

50
Q

How do you close a file

A

Close file after to avoid resource leaks

CLOSE filename (Pseudocode)
filename.close() (Python)

51
Q

What is testing all pathways through algorithm

A

Test data covers all possible paths within algorithm, complete coverage

Eg. Algorithm with if-else, test data that triggers both the if & else parts

52
Q

What is boundary condition testing

A

Focus on values above, below, or at upon which decisions are based

53
Q

What is testing where the required answer is known

A

Test data for which output already known to verify correctness

Ensure algorithm returns expected result for given input

54
Q

What is type and range checking

A

Algorithm correctly handles different data types

Algorithm operates within acceptable input range

55
Q

What is desk checking

A

Manually walk through algorithm with test data

Use trace tables

56
Q

What are trace tables

A

Tracks value of variable at each step of algorithm’s execution

Used to track values of variables and 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

57
Q

What are stepping through coded solutions

A

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 variables values and program state.

58
Q

How do you use print statements to debug code

A

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

59
Q

What are syntax errors

A

Source code of program contains mistakes, does not adhere to rules & grammar of programming language

60
Q

What are runtime errors

A

Error during program running after being successfully compiled

61
Q

What are logic errors

A

Bug in program that causes program to operator incorrectly, but doesn’t terminate / crash program

62
Q

What is an API

A

Set of rules & protocols of building & interacting with software applications

63
Q

What is purpose of APIs

A

Facilitate communication, where they allow different software applications to communicate with each other

Add functionalities to applications without writing code from scratch

Enables the integration of third-party services / data, enhancing applications capabilities

64
Q

How do you use APIs when developing software

A

Reduce development time & costs, by reusing existing services / components

Allows application to scale by integrating with other services

Developers can update functionality, without changing application code that uses it

65
Q

What are best practices when using APIs to develop software

A

Ensure secure data transfer & storage

Ensure good documentation

Properly version APIs to manage changes & maintain compatibility

66
Q

What does API stand for

A

Application Programming Interface

67
Q

Example of an API can be used to integrate third-party services into an application

A

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
Q

Is ethical and legal implications in software development crucial

A

Yes

69
Q

What is intellectual property (IP)

A

Inventions, literacy, artistic works

Software form of IP, gives creators certain exclusive rights to their work
Protected by copyrights, patents, trademarks

70
Q

What is plagiarism & acknowledgement of code

A

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
Q

What is australian copyright laws

A

Copyright protection automatic upon creation of work, doesn’t require registration

Developers must ensure they have right to use, modify, distribute software

72
Q

What is software licensing

A

Grant permissions to users under specific conditions, detailing how software can be used, modified, distributed

Proprietary Software Licences, Open Source Licences

73
Q

What is software piracy

A

Unauthorised copying, distribution, or use of copyrighted software

Fines, imprisonment, liability for damage