Computing Module - Final Exam Flashcards

1
Q

Arguments

A

Pieces of data that are sent to a function, which the function uses in calculations or other operations

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

Parameter Variables

A

Represent the inputs to the function, and are assigned the value of the arguments

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

Value-Returning Functions

A

Returns a value back to the part of the program that called it, used when the function should explicitly return a value. If a function contains NO return statement, None is automatically returned.

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

Lists

A

A collection variable that has an ordered sequence of elements, each element inside the list is called an item.
A list can hold multiple types of data

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

Count-Controlled Loops

A

A loop that iterates a specific number of times, and is written using a “for” statement. The for statement executes once for each item in the sequence.

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

Condition-Controlled Loops

A

A loop that will iterate as long as a condition is true, and is written using a “while” statement. The statement(s) under while loop iterate as long as the condition is true.

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

If statements

A

One way selection instruments, prevents an action from being performed if a condition is not right

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

If-else statements

A

Two-Way selection instruments, makes a choice between two alternative courses of action

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

If-elif-else statements

A

Multi-Way selection instruments, consider each condition until one evaluates to true or they all evaluate to false

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

Nested Decision Structures

A

Allow for consecutive decisions to be made, and a condition inside will only evaluate if the first condition evaluates to True

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

Nested Repetition Structures

A

A loop inside a loop, an inner loop goes through all of its iterations for one iteration of the outer loop

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

Preventing Software Bugs

A

Object oriented programming can improve the structure of large software systems, and software testing techniques can be developed and promoted

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

Black Box Software Testing

A

testing code without considering how it works, e.g we check to see if a given input produces desired output

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

White Box Software Testing

A

testing code knowing how coed is supposed to work, e.g. we check to see if each condition of an if statement will work when expected

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

Integration Software Testing

A

testing different sections of code working together; lets us test communication between different sections of code

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

Unit Software Testing

A

testing a specific section of code, e.g testing a single function

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

Software Bugs

A

error or flaw in computer program, causing unexpected results or incorrect behaviour

18
Q

Test Plan

A

created to finding as many software bugs as possible, and ensuring software is bug free before release

19
Q

Test Plan Cases

A

Normal Cases - expected inputs that produce a specific result
Boundary Cases- inputs that lie close to some parameter
Abnormal cases- empty lists, strings, files
Each input should have an expected output, if expected output does not match actual output, the result is a fail and vice versa

20
Q

Text File

A

contains data that has been encoded as a text; using scheme such as ASCII or unicode

21
Q

Binary File

A

contains data that has not been converted to text

22
Q

File I/O

A

consists of opening, reading, modifying, and closing files; it can help with analyzing, interpreting, and storing data with python

23
Q

Open function

A

‘r’ - open for reading only
‘w’- open file for writing
‘a’ - open a file to be written to

24
Q

.read()

A

reads entire contents of file, and returns riles contents as string

25
Q

.readline()

A

reads single line from a file and returns next line in file including the /n

26
Q

.readlines()

A

reads entire contents of a file, and returns the entire content as a list where each item is a line, including the /n

27
Q

Strings

A

an IMMUTABLE sequence of characters, they are used to store and represent textual data

28
Q

.split()

A

allows splitting of string into substrings, the default separator is whitespace (e.g space, /t, /n)

29
Q

.write()

A

writes data to a file, the value inside the parentheses is written to the file

30
Q

.writelines()

A

writes list of strings to file, the list inside the parentheses has to have all elements as strings

31
Q

object-oriented programming

A

programmers define the data type of a data structure, and also the types of operations that can be applied to the data structure

32
Q

procedural programming

A

a program made up of one or more procedures; data is passed from one procedure to another, the focus is the creation of procedures that operate on the program’s data

33
Q

Object Data Attributes

A

data contained in an object, i.e variables that contain data
each object shares the same attributes, but the value of the attributes is what differentiates them

34
Q

Object Methods

A

procedures that a object performs; i.e functions that perform objects on the objects data attributes

35
Q

Class

A

logical grouping of data and functions, defines the data that objects of the class can have and defines the methods that objects of that class can have

36
Q

Objects

A

an instance of a class, we can create as many objects of a class as we want

37
Q

Methods

A

a function defined in a class, they have access to all the data contained on the instance of an object
they define what an object can do

38
Q

__init__ method

A

special method that constructs an object of a class

- python automatically runs the __init__ method to initialize objects attributes

39
Q

self parameter

A

self is NOT an argument passed to the object, rather self is the instance of the Student

40
Q

Accessor Methods

A

allow user to observe but not change the state of an object, do not take arguments and often include return statement

41
Q

Mutator Methods

A

allows user to modify an object’s state; often begin with set, mutator methods often take arguments that are used to modify existing instance variable