Search Header Logo
JC2 09-19-25

JC2 09-19-25

Assessment

Presentation

Computers

9th - 12th Grade

Hard

Created by

Casielyn Miraflores Capistrano

FREE Resource

41 Slides • 112 Questions

1

Revision 9618

By Casielyn Capistrano

2

Computational Thinking Skills: ABSTRACTION

Abstraction is the process of removing unnecessary details from a problem to focus on the important features for implementing a solution.
Abstraction is the process of extracting information that is essential, while ignoring what is not relevant, for the provision of a solution.
Exam Tip: Remember the mnemonic
AIR - Abstraction Is Reduction.
* You reduce the complexity by hiding irrelevant details.
* Focus on the core idea, essential steps, structures or patterns.

media

3

Computational Thinking Skills: ABSTRACTION

Abstraction, think of it as an Abstract Art, artist simplify reality into essential shapes and colours just like programmers they simplify problems into key steps and data.

media
media
media

4

Computational Thinking Skills: ABSTRACTION

Examples of abstraction include modelling a:
1.
Real-life object

Example is a car in a video game, we don’t need to model every screw, wire, or mechanical detail. Instead, we abstract it into features we care about speed, color, movement. This is abstraction because we’re focusing only on relevant properties and ignoring unnecessary details.
2.
Environment
Example a 3D simulation of a city or a forest. Instead of modelling every blade of grass or grain of sand, we use simplified shapes/textures that still give the idea of the environment. The abstraction makes it manageable and understandable while still serving the purpose e.g., navigation, gameplay, training.
3.
Action
Example, pressing a button to open a door in software. In reality, pressing a button might involve electrical signals, sensors, and logic circuits. But we abstract it as just one “action”: open the door. Abstraction hides the complexity of the real mechanism.

5

Computational Thinking Skills: ABSTRACTION

4. Sequence of actions

Example, logging into a website. The real process involves encryption, server communication, database checks, and session tokens. But to the user, it’s abstracted as just enter username, enter password, click login. The whole sequence is treated as a higher-level process instead of exposing every technical step.
5.
Concept

Example is democracy or gravity. These are abstract ideas that don’t physically exist as objects. We build simplified models rules, formulas, diagrams to represent them. This is abstraction because we represent a complex, broad concept in a simplified, structured way for reasoning and communication.

6

Computational Thinking Skills: ABSTRACTION

Implementations of these include:

- a computer game that simulates playing a sport

- a simulator such as a car or flight simulator,

- a map of a bus or train route in a city
Implementations of abstractions mean real systems or tools that use abstract models to represent reality
So, when creating a program, developers must identify important features that will contribute to solving the problem or have a role to play in the solution.

media

7

Computer games

A computer game that simulates playing a sport.
The real-life sport e.g., football, basketball, tennis is abstracted into rules, graphics, and actions. The computer game implements this abstraction. Players can pass, shoot, or score without worrying about real physics, fatigue, or stadium logistics. The game doesn’t capture every detail of the sport like weather, player injuries, crowd noise in full realism, but it captures enough to simulate the experience.

media

8

A simulator such as a car or flight simulator

The abstraction here is driving a car or flying an aircraft is highly complex, involving many systems engine, aerodynamics, instruments. The simulator implements this abstraction by providing a virtual environment where the essential aspects steering, speed, navigation, cockpit controls are recreated.

Non-essential details are ignored or simplified e.g., the exact wear of tires or every microscopic airflow over a wing.

media

9

A map of a bus or train route in a city

The real city environment is full of buildings, roads, traffic, and people. The transport map implements an abstraction of just the important details: bus or train routes, stops, and connections. It leaves out unnecessary information like building heights or exact street widths, because the purpose is to navigate the transport system, not the entire city.

media

10

TYPES OF ABSTRACTION

1. DATA ABSTRACTION
- representing complex data structures in a simplified way e.g., using an array instead of raw memory addresses. It applies in DBMS to hide the underlying complexities of how data is stored and managed while in OOP to hide the low-level details of programming constructs that define underlying logic.
Example: When storing student records, instead of manually managing raw memory addresses, we use an array or record structure like:
DECLARE StudentRecord : ARRAY[1:30] OF STRING we don’t care how the computer maps each string into memory, only that StudentRecord[5] gives us the 5th student’s name.

11

TYPES OF ABSTRACTION

2. PROCEDURAL ABSTRACTION
- using functions/procedures without worrying about how they work inside. It is a programming concept where complex processes are encapsulated into procedures or functions with a name, allowing programmer to focus on what a procedure does rather than how it works internally. In other words, Procedural Abstraction is using a procedure or function without needing to know how it works internally.
Example:
Calling a library procedure like Sort(Array) or OpenFile("data.txt").

The programmer doesn’t know or need to know whether the sort is bubble sort, quicksort, or merge sort, only that the array will come back sorted.

12

TYPES OF ABSTRACTION

3. PROBLEM ABSTRACTION
- stripping away details to form a general model of the problem. Problem Abstraction means removing unnecessary details from a real-world problem to focus on its essential features.
Example:
To plan a traffic light control system, we don’t model the color of the poles, pedestrians’ clothes, or car brands.

Instead, we only model:

Traffic lights have 3 states: Red, Amber, Green

Cars stop on Red, go on Green.

Timing of light changes.

13

TYPES OF ABSTRACTION

4. FUNCTIONAL ABSTRACTION
- is a programming technique where repeated or complex processes are extracted into reusable functions, hiding their internal workings on implementation details and exposing only their purpose. It focusing on what a function does, not how it achieves it.
Example:
A function CalculateTax(income), we only care that it outputs the correct tax value.

We don’t need to know if it uses if…else, lookup tables, or switch statements inside.

14

TYPES OF ABSTRACTION

5. DECOMPOSITION or Stepwise Refinement
- Breaking a complex problem into smaller, manageable sub-problems.
Example:

Problem: Write a program to simulate a vending machine.

1. Break down into parts:

2. Display menu of items

3. Take user input (choice + payment)

4. Check if payment is sufficient

5. Dispense item and change

6. Update stock

Each part can then be solved separately and coded as a procedure.

15

During exam, when asked about abstraction, always give a definition and simple example. Usually it has 4 to 6 marks.

16

Open Ended

Define abstraction in computer science. (2 marks)

17

Abstraction is the process of removing unnecessary details and focusing only on the essential features of a problem.

Common Mistake in answering this question:
You only say “simplifying a problem” which is too vague or just saying “removing details” without mentioning essential features.

18

Open Ended

Explain, with an example, how abstraction is used in programming. (3–4 marks)

19

Abstraction is the process of removing unnecessary details and focusing only on the important features. In programming, this makes it easier to solve complex problems . For example, when a programmer calls the sortList() procedure, they do not need to know how the sorting algorithm works internally, they only need to know that it returns a sorted list.

Common Mistake in answering this question:
Giving too brief answer without mention removing unnecessary details or focusing on essentials.

You just explain how abstraction used in everyday life but forget to tie it back to programming context which is required in the question.
No example given or giving generic example like abstraction is when you use variables or misconception like abstraction is when you delete details in your code

20

Open Ended

Identify the type of abstraction when a programmer uses a pre-written library function like sqrt(). (2 marks)

21

This is an example of functional abstraction because the programmer only cares that sqrt() returns the square root, not the steps used to calculate it.

Common Mistake in answering this question:
Some common mistakes include writing “Data abstraction”, which confuses data storage with the use of functions; saying “Problem abstraction”, which incorrectly focuses on real-world simplification instead of code use; only stating the term without providing an explanation for example, just writing “Functional abstraction”, which would only gain 1 mark; and describing the algorithm inside sqrt() such as Newton’s method, which is irrelevant and would lose the explanation mark.

22

Open Ended

Describe the role of abstraction when designing an algorithm to simulate traffic lights. (4 marks)

23

Model Answer:
Abstraction removes unnecessary details and focuses only on the essential features of the traffic light system. For example, the simulation only needs to represent the lights as having three states, Red, Yellow, and Green and the rules for changing between them. It does not need to include details such as the colour of the traffic light poles, the type of light bulbs, or the make of the cars. This reduction in complexity makes the algorithm easier to design and understand.

Common Mistake in answering this question:
Writing only “Abstraction makes it simpler” without context. Just saying “Breaks the traffic system into smaller steps” that’s decomposition, not abstraction. Or writing about making the traffic lights automatic instead of simplifying the model. And not mentioning what details are kept vs ignored.

24

Open Ended

Explain the difference between problem abstraction and data abstraction, with examples. (6 marks)

25

Model Answer:
Problem abstraction is the process of removing unnecessary real-world details to create a simplified model of the problem. Example: In a traffic light simulation, only the red, amber, and green states are represented, not the design of the poles or brands of cars. Data abstraction is the process of hiding how data is stored in memory and representing it in a logical structure instead. Example: Using an array to store student names rather than handling raw memory addresses. The difference is that problem abstraction simplifies what aspects of reality are modelled, while data abstraction simplifies how data is represented in a program.

Common Mistake in answering this question:
Giving two definitions but no examples, mixing them up, e.g., saying problem abstraction is using an array which confuses with data abstraction. Giving two unrelated examples without explaining the difference. Writing only one-word differences like problem = real world, data = data without elaboration. And not linking the examples to the abstraction type.

26

Open Ended

Evaluate how abstraction helps in the development of complex software systems. (8 marks)

27

Model Answer:
Abstraction helps in the development of complex software systems by reducing unnecessary detail, which makes problems easier to manage and understand. Large problems can be broken down into smaller, simpler components through decomposition, and each part can be solved independently. Using procedural and functional abstraction, programmers can reuse modules and functions without knowing their internal code, saving development time. Data abstraction allows the program to handle complex structures logically without worrying about low-level memory management. Overall, abstraction reduces complexity, improves maintainability, and supports teamwork, since different developers can work on separate modules. It also makes software more scalable and easier to debug or extend in the future.

Common Mistake in answering this question:
Just defining abstraction without evaluating its role in software development, only giving one type of abstraction e.g., just problem abstraction instead of showing a range. Confusing abstraction with encapsulation or generalisation. Writing vague benefits like abstraction makes programs better without linking to complexity, maintainability, or teamwork. Not using software development context students sometimes give real-world analogies like Google Maps, which won’t earn high marks here.

28

Multiple Choice

A programmer uses a procedure sortList() without knowing its algorithm. Which type of abstraction is this?

1

Data abstraction

2

Procedural abstraction

3

Functional abstraction

4

Problem abstraction

29

​Q. A programmer uses a procedure sortList() without knowing the underlying algorithm. Which type of abstraction is this?

A. Procedural Abstraction

Because the programmer is making use of a procedure without worrying about how it works internally. The programmer is using a procedure (sortList) without caring if it’s bubble sort, quicksort, or merge sort. That’s procedural abstraction.

30

Multiple Choice

A library management system stores books in an array of records rather than tracking raw memory addresses. Which type of abstraction is applied here?

1

Data abstraction

2

Procedural abstraction

3

Functional abstraction

4

Problem abstraction

31

​Q. A library management system stores books in an array of records rather than tracking raw memory addresses. Which type of abstraction is applied here?

A. Data Abstraction

In data abstraction, the raw memory management is hidden, and the array provides a simplified logical structure for storing and accessing data.

32

Multiple Choice

A program models a traffic light system by only representing Red, Yellow, and Green states, ignoring details such as pole design or light bulb brand. What type of abstraction is used?

1

Data abstraction

2

Procedural abstraction

3

Functional abstraction

4

Problem abstraction

33

​Q. A program models a traffic light system by only representing Red, Yellow, and Green states, ignoring details such as pole design or light bulb brand. What type of abstraction is used?

A. Problem Abstraction

This is about simplifying a real-world problem to its essential details, which is known as problem abstraction.
if we are designing a program to simulate a traffic light system, we do not need to model the shape of the pole, the brand of the bulbs, or the colour of the paint. These details are irrelevant to the problem being solved. Instead, we only keep the essential details: the traffic light has three states (Red, Yellow, Green), cars stop when the light is Red, and cars go when the light is Green. By abstracting away the irrelevant information, the programmer can focus on the core logic of the problem and design an algorithm that is simpler, clearer, and more efficient. This makes it easier to implement and reduces the risk of being distracted by unnecessary complexity.

34

Multiple Choice

A complex program to simulate a vending machine is divided into smaller parts: display menu, take payment, check stock, dispense item, give change. This is an example of:

1

Decomposition

2

Procedural abstraction

3

Functional abstraction

4

Problem abstraction

35

​Q. The vending machine program is broken down into smaller sub-problems such as displaying the menu, taking payment, checking stock, dispensing the item, and giving change.

A. Decomposition

Decomposition means splitting a large, complex task into manageable modules. Each sub-problem can be solved and tested separately, making the overall system easier to design, code, and debug.

36

Multiple Choice

Using LENGTH(string) in pseudocode without needing to know how the system counts characters is an example of:

1

Decomposition

2

Procedural abstraction

3

Functional abstraction

4

Problem abstraction

37

​Q. Using LENGTH(string) in pseudocode without needing to know how the system counts characters is an example of

A. Procedural Abstraction

LENGTH(string) is a predefined procedure. The user doesn’t care how characters are counted.

38

Multiple Choice

A programmer decides to represent a chess board as an 8×8 2D array, rather than modelling each square’s memory location individually. Which abstraction is used?

1

Decomposition

2

Procedural abstraction

3

Functional abstraction

4

Data abstraction

39

​Q. A programmer decides to represent a chess board as an 8×8 2D array, rather than modelling each square’s memory location individually. Which abstraction is used?

A. DATA Abstraction

The 2D array hides low-level memory allocation and gives a logical structure


40

Multiple Choice

In designing a school timetable system, the programmer ignores students’ hair colour, hobbies, and breakfast details. Which type of abstraction is applied?

1

Data abstraction

2

Procedural abstraction

3

Functional abstraction

4

Problem abstraction

41

​Q. In designing a school timetable system, the programmer ignores students’ hair colour, hobbies, and breakfast details. Which type of abstraction is applied?

A. Problem Abstraction

Problem abstraction means removing unnecessary real-world details and focusing only on the essential aspects needed to solve the problem. In this case, the only relevant details are subjects, teachers, times, and rooms, extra personal information is not needed.

42

DECOMPOSITION

Decomposition is breaking down a big problem into smaller problems so that they can be solved independently. Decomposition is the process of breaking down a complex problem or system into smaller, more manageable sub-problems that can be solved independently and then combined to produce the overall solution.
Think of Decomposition as Divide to Conquer

43

Benefits of DECOMPOSITION

Programmers use decomposition to (BIIS):

Break problems down

Identify the steps, parts or processes involved in a problem

Identify reusable components

Split tasks between programmers

Remember the acronym "PETM" (Pet-Me)
Planning where the problems are break into sub-tasks
Easier debugging
Testing individually
Maintenance simpler

44

DECOMPOSITION

Why it matters?
Design
- Decomposition makes programs easier to design because the solution can be built step by step.
WRITE
- It makes them easier to write since the program is divided into smaller chunks of code.
Test
- It simplifies testing because errors can be located more easily.
Maintain
- It improves maintenance as changes can be made in one module without affecting the whole system.
Reuse
- it supports reuse since sub-problems written as functions or procedures can be reused in other programs.

45

DECOMPOSITION

In the case of slow appointment booking, you could decompose the problem into issues such as server limitations during peak hours, inefficient backend algorithms, and user interface delays

media

Process of decomposition to break problems down

46

Using abstraction to design a solution

Before we start to break problems down, it is often useful to apply the rules of abstraction to the problem

Applying abstraction will remove non-essential elements and that programmers can focus on critical aspects for problem-solving

When addressing a slow booking system, a programmer could ignore elements like the system's colour scheme or graphics and focus on critical performance metrics such as server response time and database query efficiency

47

Decomposing slow response times problem

media

48

Open Ended

What is decomposition in problem-solving?

49

Model Answer: Decomposition is the process of breaking a large problem into smaller, more manageable parts that can be solved independently.
Decomposition means breaking a large or complex problem into smaller, more manageable sub-problems that can be solved independently and then combined to form the complete solution.

Common Mistake in answering this question:
When just say breaking down without mentioning that the parts should be manageable or solvable on their own.

50

Open Ended

Explain how decomposition helps when designing a large program.

51

Model Answer: Decomposition helps because tasks can be allocated to different programmers, modules can be reused in other programs, testing and debugging are easier on smaller sections, and it supports structured programming.
Decomposition helps by making it easier to divide tasks among programmers, reuse modules in other programs, test and debug smaller sections, and keep the program structured and easier to maintain.

Common Mistake in answering this question:
When you only mention it makes it easier without giving specific benefits like reuse, testing, maintenance.

52

Open Ended

A school system needs to manage students, teachers, and classes. Show how decomposition could be applied

53

Model Answer: The main system can be decomposed into Student Management, Teacher Management, and Class Scheduling. Student Management can then be further broken down into Add Student, Update Student, and Search Student modules.
complex system like a school database is divided into major sub-systems students, teachers, classes, and each sub-system is further broken down into smaller functions e.g., add, update, search.

Common Mistake in answering this question:
When you give vague answers like divide the school system without showing sub-level breakdown.

54

Open Ended

Explain how decomposition is used in pseudocode/programming.

55

Model Answer: Decomposition is shown in pseudocode by using functions or procedures to represent sub-problems. For example:
PROCEDURE Main

CALL InputMarks

CALL CalculateGrades

CALL PrintReport

ENDPROCEDURE
In programming, decomposition is applied through the use of functions and procedures, where each module represents one sub-problem. The main program calls these modules to form the complete solution.

Common Mistake in answering this question:
When you just list procedures without explaining that they represent sub-problems.

56

Open Ended

Distinguish between decomposition and abstraction

57

Model Answer: Decomposition means breaking a problem into smaller sub-problems. Abstraction means hiding unnecessary details and focusing only on the essential features.
Decomposition focuses on splitting the problem into smaller parts, while abstraction removes unnecessary details so we can focus on what’s important.

Common Mistake in answering this question:
When you confuse the two by writing only one definition or saying they are the same.

58

media

​Pattern recognition is used to identify those parts that are similar and could use the same solution. This leads to the development of reusable program code in the form of subroutines, procedures and functions. When writing a computer program, each final part is defined as a separate program module that can be written and tested as a separate procedure or function, as shown in Figure 9.2. Program modules already written and tested can also be identified and reused, thus saving development time.

59

Try to Answer the following:

60

Multiple Choice

What is abstraction?

1

Removal of certain details, keeping relevant the information

2

Stores data in a program for retrieval

3

Freedom from representing art

4

Detects errors while program is running

61

Multiple Choice

What is an algorithm?

1

A very complicated thing.

2

A series of step by step instructions to do a task.

3

A long story.

4

A game.

62

Multiple Choice

Can you skip a step while making an algorithm?

1

Yes

2

No

63

Multiple Select

The steps of an algorithm can be followed in any order to produce the same result.

1

True

2

False

64

Multiple Select

A complete algorithm helps in performing a specific task.

1

True

2

False

65

Multiple Choice

An _______________ is a precise,step by step set of instructions to perform a specific task.

1

task

2

sequence

3

sub-tasks

4

algorithm

66

Multiple Choice

What is Debugging?

1

A problem in the program.

2

A way to find the bug.

3

A way to find the problem and fix it.

67

Multiple Choice

What is a bug?

1

A problem in the algorithm.

2

A way to fix the problem.

3

A list of steps.

68

Multiple Choice

What is Sequence?

1

A set of instructions for computer.

2

An order of events.

69

Multiple Choice

To sequence means to ____________.

1

put things in order

2

to tell what it's mostly about

3

to figure out what is happening

70

Multiple Choice

What is an algorithm?

1

A sequence of steps used to solve a problem, which presents a unique method of addressing this situation.

2

A sequence used only to represent mathematical concepts.

3

An sequence which is never finite, well-defined. or effective.

71

Multiple Choice

What does DSA stand for?

1

Dynamic Systems Analysis

2

Data Structures and Algorithms

3

Data Storage and Access

4

Dynamic Software Architecture

72

Multiple Select

What will the following are not logical operators?

1

AND

2

<

3

OR

4

==

73

Multiple Choice

Which pseudocode correctly asks the user to input their name and outputs a greeting?

1

OUTPUT "Hello"

2

INPUT name

3

OUTPUT "Enter your name:"

4

INPUT name; OUTPUT "Hello, " + name

74

Multiple Choice

What is the primary purpose of assembly language?

1

To create high-level programming languages.

2

To directly execute programs without compilation.

3

The primary purpose of assembly language is to provide a human-readable representation of machine code for programming and controlling computer hardware.

4

To simplify the use of graphical user interfaces.

75

Multiple Choice

What is the purpose of a function in Python?

1

The purpose of a function in Python is to encapsulate code for reuse and organization.

2

To define variables in Python

3

To handle exceptions in Python

4

To create classes in Python

76

Multiple Choice

What is the primary role of a computer programmer?

1

To create user interfaces

2

To design hardware components

3

To write, modify, and test code

4

To manage network systems

77

Multiple Choice

What is the mother tongue of computers?

1

English

2

French

3

Machine code

4

Python

78

Multiple Choice

The first generation of programming language is

1

Machine code

2

Assembly language

3

High Level language

4

Python

79

Multiple Choice

Python and Java are examples of

1

Machine Code

2

Assembly language

3

High level language

4

Low level language

80

Multiple Choice

An example of a second generation language is

1

Machine code

2

Assembly language

3

High level language

4

Python

81

Multiple Choice

Instructions in machine code are in

1

English

2

French

3

Python

4

Binary

82

Multiple Choice

Assembly language makes use of

1

English words

2

Commands

3

Mnemonics

4

SQL commands

83

Multiple Choice

High level language makes use of

1

English words

2

Python commands

3

Mnemonics

4

Binary codes

84

Multiple Choice

Programs in machine code are

1

Machine oriented

2

Mnemonics

3

Problem oriented

4

Letter codes

85

Multiple Choice

Programs in HLL are

1

Machine oriented

2

Mnemonics

3

Memory Oriented

4

Problem oriented

86

Multiple Choice

Machine code and Assembly language are examples of

1

High level languages

2

Machine language

3

Low level languages

4

SQL Commands

87

Fill in the Blanks

88

Fill in the Blanks

89

Fill in the Blanks

90

Fill in the Blanks

91

Fill in the Blanks

92

Multiple Choice

How do you define a function in Python?

1

def function_name(parameters):

2

function_name(parameters) =>

3

create function_name(parameters)

4

function_name: parameters()

93

Multiple Choice

What is the difference between a function and a method in Python?

1

A function can only return a value, while a method cannot.

2

Methods are defined outside of classes, while functions are defined inside classes.

3

A function is independent, while a method is associated with an object.

4

A method is a type of function that cannot take parameters.

94

Multiple Choice

How can you return multiple values from a function?

1

Use a list to return values.

2

Return a single value only.

3

Return values through global variables.

4

Use a tuple to return multiple values from a function.

95

Multiple Choice

What is a common debugging technique in Python?

1

Using a debugger tool

2

Using print statements for debugging

3

Writing unit tests

4

Ignoring error messages

96

Multiple Choice

How can you use print statements for debugging?

1

Insert print statements to display variable values and program flow at key points in the code.

2

Insert print statements only at the beginning of the code.

3

Remove all print statements to avoid clutter in the output.

4

Use print statements to write comments in the code.

97

Multiple Choice

What is the purpose of the assert statement in debugging?

1

To optimize code performance during execution.

2

To verify assumptions and catch errors during debugging.

3

To automatically fix errors in the code.

4

To enhance the user interface of the application.

98

Multiple Choice

What tools can be used for debugging in Python?

1

pdb, logging, IDEs (PyCharm, VS Code), ipdb, PySnooper

2

assertions

3

try-except blocks

4

print statements

99

Multiple Choice

What is the syntax for a for loop in Python?

1

for variable in sequence[]

2

for (variable : sequence)

3

for each variable in sequence:

4

for variable in sequence:

100

Multiple Choice

How do you iterate over a list using a for loop?

1

for item in my_list: print(item)

2

for item in range(len(my_list)): print(my_list[item])

3

for item in my_list: print(item, end='')

4

for item in my_list: item.print()

101

Multiple Choice

What is the difference between a for loop and a while loop?

1

A for loop iterates a known number of times, while a while loop continues until a condition is false.

2

A for loop runs indefinitely, while a while loop stops after a set number of iterations.

3

A for loop is used for conditional statements, while a while loop is used for iteration.

4

A for loop requires a condition, while a while loop does not need any conditions.

102

Multiple Choice

How can you use the range() function in a for loop?

1

You can use range() to generate random numbers in a for loop.

2

You can use range() to create a list of strings.

3

You can use range() in a for loop to iterate over a sequence of numbers.

4

range() is used to define the number of iterations in a while loop.

103

Multiple Choice

What is the syntax for a while loop in Python?

1

for condition: code to execute

2

repeat condition: code to execute

3

do while condition: code to execute

4

while condition: # code to execute

104

Multiple Choice

What is the purpose of the break statement in loops?

1

The break statement continues to the next loop iteration.

2

The break statement terminates the loop execution.

3

The break statement skips the current iteration of the loop.

4

The break statement pauses the loop execution.

105

Multiple Choice

How can you use the continue statement in a loop?

1

The continue statement is used to exit the loop completely.

2

You can use the continue statement in a loop to skip the current iteration and continue with the next one.

3

You can use the continue statement to restart the loop from the beginning.

4

The continue statement ends the loop immediately.

106

Multiple Choice

Which of the following is an example of an assembly language instruction?

1

PRINT

2

IF

3

MOV

4

FOR

107

Multiple Choice

An assembler is a software tool that:

1

compiles high-level code into assembly language

2

optimizes machine code for performance

3

translates assembly language into machine code

4

debugs machine code for errors

108

Multiple Choice

An algorithm is a:

1

A step-by-step procedure for solving a problem.

2

A method for storing information

3

A type of programming language

4

A random collection of data

109

Multiple Choice

Which of the following is a simple algorithm?

1

Finding the median in a dataset

2

Sorting a list of numbers

3

Finding the maximum number in a list

4

Calculating the average of a set of values

110

Multiple Choice

Why are algorithms important in computer science?

1

Algorithms are crucial for problem-solving, efficiency, and data management in computer science.

2

Algorithms are primarily for graphic design in computer science.

3

Algorithms are only used for sorting data.

4

Algorithms are irrelevant in modern programming languages.

111

Multiple Choice

Pseudocode is used to:

1

Describe an algorithm in a human-readable format

2

Write actual code

3

Create flowcharts

4

Debug programs

112

Multiple Choice

Which of the following is a common pseudocode keyword?

1

PRINT

2

IF

3

FOR

4

All of the above.

113

Multiple Choice

A compiler translates:

1

High-level code into machine code

2

Assembly code into machine code

3

Machine code into assembly code

114

Multiple Choice

An interpreter:

1

Executes machine code directly

2

Converts assembly code into machine code

3

Creates executable files

4

Translates and executes code line by line

115

Multiple Choice

Which of the following is a compiled language?

1
  • Python

2
  • Java

3
  • JavaScript

4
  • Ruby

116

Multiple Choice

Which of the following is an interpreted language?

1
  • C++

2
  • C#

3
  • Python

4
  • Pascal

117

Multiple Select

What is the main differences between a compiler and an interpreter?

1

Compilers are faster, while interpreters are slower

2
  • Compilers create executable files, while interpreters do not

3
  • Compilers are used for high-level languages, while interpreters are used for low-level languages

4
  • Compilers translate code once, while interpreters translate code line by line

118

Open Ended

Write Pseudocode to this problem :Calculate the Area of a Rectangle

119

Open Ended

Write Pseudocode to this problem : Find the Largest Number Between Two Numbers

120

Open Ended

Write a Pseudocode to this problem : Eat a Fruit

Imagine you're hungry, and you want to eat a fruit. However, before eating it, you need to check whether the fruit is clean (washed). If it's already washed, you can eat it right away. If not, you need to wash it first. Once you've eaten the fruit, you'll decide whether you want to eat more.

121

Multiple Choice

Question image

What does the following pseudocode do?

1

Outputs 5

2

Outputs 3

3

Outputs 8

4

Outputs 15

122

Multiple Choice

Question image

What is the output of this pseudocode if age = 20?

1

Adult

2

Minor

3

18

4

No output

123

Multiple Choice

Question image

How many times does the following loop run?

1

4

2

5

3

6

4

Infinite

124

Multiple Choice

Question image

What is the condition to stop the following loop?

1

When x < 10

2

When x = 10

3

When x > 10

4

When x = 0

125

Multiple Choice

Question image

What is the output of this pseudocode?

1

Success

2

Fail

3

Error

4

No output

126

Multiple Choice

Question image

What does the following pseudocode calculate?

1

A) The sum of numbers from 1 to 5

2

B) The product of numbers from 1 to 5

3

C) The sum of even numbers from 1 to 5

4

D) The sum of odd numbers from 1 to 5

127

Multiple Choice

What will the following boolean expression evaluate to?

5 <= 5

1

FALSE

2

TRUE

128

Multiple Choice

What will the following pseudocode output? Assume all variables have been declared.

x ← 3

IF x < 5

THEN

OUTPUT "A"

ELSE

OUTPUT "B"

ENDIF

1

A

2

B

3

<No output>

129

Multiple Choice

What will the following pseudocode output? Assume all variables have been declared.

x ← 3

y ← 4

IF x < 5 AND y > 5

THEN

OUTPUT "A"

ELSE

OUTPUT "B"

ENDIF

1

A

2

B

3

<No output>

130

Multiple Choice

What will the following pseudocode output? Assume all variables have been declared.

x ← 3

y ← 4

IF x < 5

THEN

OUTPUT y * 5

ELSE

OUTPUT y * 2

ENDIF

1

15

2

8

3

20

4

6

131

Multiple Choice

What will the following pseudocode output? Assume all variables have been declared.

x ← 3

y ← 4

z ← 5

IF x == 5

THEN

OUTPUT "A"

ELSE

IF y <> z

THEN

OUTPUT "B"

ELSE

OUTPUT "C"

ENDIF

ENDIF

1

A

2

B

3

C

132

Multiple Choice

What will the following pseudocode output? Assume all variables have been declared.

x ← 3

CASE OF x

1: OUTPUT x * 1

2: OUTPUT x * 1 + 1

3: OUTPUT x * 2

4: OUTPUT x * 2 + 1

ENDCASE

1

3

2

4

3

6

4

7

133

Multiple Choice

What will the following pseudocode output? Assume all variables have been declared.

w ← 2

x ← 2 * w

CASE OF x

1: OUTPUT w * 1

2: OUTPUT w * 1 + 1

3: OUTPUT w * 2

4: OUTPUT w * 2 + 1

OTHERWISE OUTPUT x

ENDCASE

1

2

2

3

3

4

4

5

134

Multiple Choice

Which data structure follows the Last In, First Out (LIFO) principle?

1

Linked List

2

Array

3

Stack

4

Queue

135

Multiple Choice

What is the primary purpose of sorting algorithms?

1

To store data efficiently

2

To arrange elements in a specific order

3

To analyze algorithm performance

4

To search for specific data

136

Multiple Choice

Which algorithm is used to find the shortest path in a graph?

1

Bubble Sort

2

Dijkstra's Algorithm

3

Binary Search

4

Merge Sort

137

Multiple Choice

What is a characteristic of a queue data structure?

1

Elements are accessed in a random order

2

Elements are added and removed from the same end

3

Elements are stored in a non-linear fashion

4

Elements are added at one end and removed from the other

138

Multiple Choice

Which of the following is a non-linear data structure?

1

Stack

2

Array

3

Queue

4

Tree

139

Multiple Choice

What is the main advantage of using dynamic programming?

1

It requires less time complexity

2

It avoids redundant computations

3

It uses more memory

4

It is easier to implement

140

Multiple Choice

Which of the following is NOT a type of searching algorithm?

1

Linear Search

2

Binary Search

3

Heap Sort

4

Depth First Search

141

Multiple Choice

What would be a first step to make a toast?

1

When toast pops up add butter

2

Turn on and set temperature/timer

3

Remove toaster from drawer

142

Open Ended

Short algorithm to prepare a sandwich (from Activity 2)

143

Multiple Choice

To write an algorithm for every arithmetical operation, you must use the following.

1

Pseudocode

2

Flowchart

3

You may use both

144

Multiple Choice

Symbol used in a flowchart to ask for a number to a user.

1

Oval.

2

Paralelogram

3

Rectangle

145

Multiple Choice

Symbol used in a flowchart to do an arithmetical operation.

1

Oval.

2

Paralelogram

3

Rectangle

146

Multiple Choice

First step for an algorithm to calculate an average of two numbers

1

Start.

2

Ask number1 to the user.

3

Declare variables: number1, number2, sum, average.

147

Open Ended

Short algorithm for a geometric shapes area (Activity 4)

148

Multiple Choice

What is one of the three requirements for an algorithm?

1

Infinite

2

Well-defined

3

Ineffective

149

Multiple Choice

Which of the following is NOT true about procedural abstraction?

1

Procedural abstraction improves code readability

2

Procedural abstraction manages complexity by allowing for code reuse

3

Procedural abstraction improves the speed at which a program executes

4

Procedural abstraction allows a solution to a large problem to be based on the solution of smaller subproblems

150

Multiple Choice

An object is an instance of a:
1
parameter
2
method
3
class
4
application

151

Multiple Choice

Which of the following concepts of OOPS means exposing only necessary information to client?
1
Encapsulation
2
Abstraction
3
Data hiding
4
Data binding

152

Multiple Choice

________ is wrapping of data into a single unit called class.

1

Abstraction

2

Polymorphism

3

Encapsulation

4

Inheritance

153

Multiple Choice

What is packet encapsulation in networking?

1

The process of stripping headers and trailers from a packet

2

The process of adding an IP address to a packet

3

The process of adding headers and trailers to data

4

The process of checking for errors in network transmission

Revision 9618

By Casielyn Capistrano

Show answer

Auto Play

Slide 1 / 153

SLIDE