1Define the three components of a problem in program development
Inputs, Outputs, and Processing
2What tool represents Inputs, Processing, and Outputs?
An IPO Chart
3What is the purpose of outlining the solution?
To identify major tasks, subtasks, structures, and variables
4What is an algorithm?
A clear, step-by-step set of instructions
5What tools commonly represent algorithms?
Pseudocode and Flowcharts
6Why do we desk check algorithms?
To find logic errors early
7What is coding the algorithm?
Translating the algorithm into a programming language
8What is the final step of program development?
Documenting and maintaining the program
9What is pseudocode?
Steps describing a solution’s logic in plain English
10What keywords in pseudocode represent input?
READ, INPUT
11What keywords in pseudocode represent output?
PRINT, DISPLAY
12What keywords represent decisions?
IF, THEN, ELSE
13What symbols in a flowchart represent start/end?
Terminal (oval/lozenge)
14Which flowchart symbol is used for I/O?
Parallelogram
15Which symbol represents a process?
Rectangle
16Which symbol represents decisions?
Diamond
17What is a variable in Python?
A named storage for a value
`x = 5`
18What does type() do?
Shows the data type of a value
`type(10) # int`
19What is type casting?
Converting a value into another type
`x = int("5")`
20What are the arithmetic operations in python?
+, -, *, /, //, **, %
21What is comparison in Python?
<, <=, >, >=
22Runs code only if condition is true
``
if age > 18:
print("Adult")
``
23What is a two-way decision?
Runs one block if true, another if false
``
if num > 0:
print("Positive")
else:
print("Not positive")
``
24What is a multi-way decision?
Checking several conditions
``
if grade >= 80:
print("A")
elif grade >= 60:
print("B")
else:
print("C")
``
25What is a while loop?
Repeats while a condition is true
``
i = 1
while i <= 3:
print(i)
i += 1
``
26Repeats a known number of times
``
for i in range(3):
print(i)
``
27What does break do?
Stops the loop immediately
``
for i in range(5):
if i == 3:
break
``
28What does continue do?
Skips the rest of the current loop iteration
29What is a function?
Reusable code defined with def
``
def greet():
print("Hello")
``
30What is a parameter?
A variable in a function definition
``
def add(x, y):
return x + y
``
31What is an argument?
A value passed to a function when calling it
`add(3, 4)`
32What is return used for?
Sending back a result
``
def square(n):
return n * n
``
33What is string indexing?
Accessing characters by position
``
name = "John"
name[1] # 'o'
``
34What is slicing?
Extracting part of a string
`"Hello"[1:4] # 'ell'`
35What is string concatenation?
Joining strings with +
`"Hi " + "there" # "Hi there"`
36What is a list?
A mutable ordered collection
``
nums = [1, 2, 3]
nums.append(4)
``
37What is a tuple?
An immutable ordered collection
`t = (1, 2, 3)`
38What is a set?
Unordered collection of unique items
`s = {1, 2, 2, 3} # becomes {1, 2, 3}`
39What is a dictionary?::
Key-value pairs
`student = {"name": "Alice", "age": 20}`
40What are the steps of file handling?:
Open, read/write, close
``
f = open("data.txt", "r")
content = f.read()
f.close()
``
41What does try-except do?
Handles runtime errors
``
try:
print(10 / 0)
except:
print("Error occurred")
``