Skip to content
Exam 10 questions

Introduction to Algorithms

Questions 10

The answer key is shown to signed-in teachers.

  1. Multiple choicesoftware

    Definition of an algorithm

    Which of the following best describes an algorithm?

    1. A programming language used only for websites

    2. A finite, ordered set of clear steps that solves a problem

    3. A random collection of computer instructions

    4. A type of computer hardware used for storage


    Think about what a recipe does: it lists steps in a specific order to reach a result.
  2. Multiple choicesoftware

    Purpose of a flowchart

    What is the main purpose of a flowchart in software development?

    1. To compile source code into machine code

    2. To test the speed of an internet connection

    3. To show the steps of a process visually using standard symbols

    4. To store data in a database


    A flowchart uses shapes like ovals, rectangles, and diamonds to draw how a process moves from start to finish.
  3. Multiple choicesoftware

    Flowchart decision symbol

    In a standard flowchart, which shape is used to represent a condition that leads to two possible paths, such as Yes or No?

    1. Parallelogram

    2. Oval

    3. Diamond

    4. Rectangle


    This shape is used when the program must check something and choose between two branches.
  4. Multiple choicesoftware

    Purpose of a loop

    Which statement best describes the purpose of a loop in a program?

    1. To permanently delete unused variables from memory

    2. To repeat a block of instructions while a condition is met or for a set number of times

    3. To connect two separate computers over a network

    4. To skip all instructions in a program


    Consider a task you repeat many times, such as counting from 1 to 10 or walking until you reach a door.
  5. Multiple choicesoftware

    Conditional statements

    Consider the statement: if the temperature is above 30, print 'Hot'; otherwise, print 'Not hot'. What kind of control structure is this?

    1. A loop structure

    2. A variable declaration

    3. A condition (selection) structure

    4. A file storage command


    The program chooses one of two outputs depending on whether a statement is true or false.
  6. Multiple choicesoftware

    Tracing a loop

    What value does total have after the following pseudocode runs? total = 0; for i = 1 to 4: total = total + i. (Note: the loop adds 1, then 2, then 3, then 4.)

    1. 6

    2. 4

    3. 10

    4. 12


    Trace each pass through the loop and add the value of i to total each time, starting from 0.
  7. Multiple choicesoftware

    Algorithm efficiency and correctness

    Which property must a good algorithm have so that it always ends and produces a result?

    1. Finiteness

    2. Infinite repetition

    3. Dependence on a specific computer brand

    4. Randomness


    A good algorithm must not run forever; it should stop after a limited number of steps.
  8. True / falsesoftware

    Flowchart Symbols

    In a standard flowchart, a diamond shape is used to show a decision or condition that can lead to two different paths.

    1. True

    2. False


    Think about the shape that has a question inside it and branches into Yes and No paths.
  9. True / falsesoftware

    Loop Behaviour

    A while loop always runs its body at least once, even if its condition is false at the start.

    1. True

    2. False


    Compare a while loop with a loop that checks its condition after the body has run.
  10. True / falsesoftware

    Algorithm Steps

    An algorithm must be written as a list of steps in a clear order, and each step must be precise enough for a computer or person to carry out without guessing.

    1. True

    2. False


    Consider what makes instructions clear enough to follow exactly, with no room for interpretation.

About

Basic algorithms, flowcharts, loops and conditions, with questions on reading and writing simple steps.
Subjects
software
Audience
Junior High School · Grades 8–9
Difficulty
4 out of 10
Language
English
Who can see it
Everyone
Written by AI
Claude Haiku 5.5
Created

Comments

  1. No comments yet.
© All Rights Reserved