401 Flashcards

Assessment 2

1
Q

What are the four stages of SDLC?

A

Requirement analysis, Design, Implementation, Testing.

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

What are the five stages of SDLC / what is the fifth stage of SDLC?

A

The fifth stage is Deployment. The optional sixth is Maintenance.

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

Two different ways of meeting user requirements. What are they? Advantages and Disadvantages.

A

1) Interview: allows detailed feedback but time-consuming. 2) Questionnaire: quicker but less in-depth.

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

What are three properties of an IDE? What can IDE not do?

A

Syntax highlighting, auto-completion, debugging tools. Cannot ensure logic correctness or remove all bugs.

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

Using a labelled diagram briefly explain what a flowchart is. Advantages and disadvantages.

A

Flowchart: diagram showing logic flow using symbols (start/end, actions, decisions). Advantage: visual clarity. Disadvantage: can become complex.

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

Using a labelled diagram briefly explain what a pseudocode is. Advantages and disadvantages.

A

Pseudocode: informal, human-readable steps. Advantage: easy to write. Disadvantage: not executable.

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

What is casting?

A

Casting is converting a value from one data type to another (e.g., float to int).

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

Using a labelled diagram briefly explain what a variable is.

A

A variable is a named storage in memory. Diagram: shows variable name pointing to value in memory.

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

List the rules for naming variables.

A

Must start with a letter or underscore, case-sensitive, no special symbols, no Python keywords.

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

List the comparison operators.

A

==, !=, >, <, >=, <=

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

List the arithmetic operators (6).

A

+, -, *, /, %, **

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

Using labelled diagram briefly explain three types of selection.

A

If, if-else, if-elif-else (diagram: branch logic flow based on conditions).

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

What are the two main types of iteration?

A

While loop and for loop.

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

With examples, briefly explain three simple data types.

A

int (e.g. 5), float (e.g. 3.14), bool (e.g. True).

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

With an example briefly explain what a string is and how it is not the same as a simple data type.

A

A string is a sequence of characters (e.g. ‘hello’) — not a primitive numeric type, it’s immutable.

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

Using a small piece of code, briefly explain the syntax of a function and how a function works.

A

def greet(): print(‘Hello’) – ‘def’ defines the function, ‘greet()’ calls it.

17
Q

Using an example, briefly explain what concatenation is.

A

‘Hello’ + ‘ World’ = ‘Hello World’.

18
Q

Write a piece of code to convert the keyboard entry to be converted to an int.

A

user_input = int(input(‘Enter a number: ‘))

19
Q

Using a piece of code briefly explain what is meant by string slicing.

A

s = ‘Python’; print(s[1:4]) → ‘yth’ – slicing extracts a substring.

20
Q

What is a function?

A

A function is a reusable block of code that performs a specific task.

21
Q

Write a syntactically correct program for a function and a function call.

A

def greet(): print(‘Hi’); greet()