Lesson 4.1.2.2

4.1.2.2 Procedural-oriented programming and hierarchy charts Quiz: AQA Computer Science, Unit 1

20 questions

In partnership with Revision Ninja

Lesson 4.1.2.2, Procedural-oriented programming and hierarchy charts: 20 multiple choice questions for the AQA Computer Science (7517), Unit 1: Fundamentals of programming, written with Revision Ninja.

Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.

Host this setFree Play

The 20 questions

  1. What is a hierarchy chart used for in procedural program design?

    • Showing the relationships between classes only, with inheritance drawn as a line between them
    • Showing the flow of data around a network, from each client to the server and back again
    • Showing how a main program is broken into subroutines and how they are organised
    • Showing the layout of a database table, with the fields and keys drawn as boxes on the page
  2. In a hierarchy chart, what does the top box usually represent?

    • The smallest subroutine, which sits at the very bottom of the chart and has no calls below it
    • The main program or overall task
    • A variable, drawn at the top so that it can be read by every module in the chart
    • A file on disk, which is shown at the top of the chart as the source of all the data
  3. What is the main advantage of the structured (procedural) approach to program design?

    • It removes the need for any subroutine calls, so each module is written as one long sequence
    • It avoids the need to plan the program, since the structure is worked out while coding
    • It makes all data global so it is easy to find, with every module able to read every value
    • It breaks a problem into manageable parts that can be designed, coded and tested separately
  4. Top-down design means which of the following?

    • Writing the smallest module first and joining them at the end
    • Starting from the overall task and refining it into smaller subproblems
    • Designing the database before the user interface
    • Testing the program only after it is released
  5. A hierarchy chart shows a main module calling three subroutines: input, process and output. How many subroutines are directly called by the main module?

    • 4
    • 2
    • 3
    • 1
  6. Which statement about a hierarchy chart is correct?

    • Boxes represent only the output screen
    • Lines show the order of loop iterations only
    • Each box represents a module, and lines show which module calls which
    • Each box represents a variable, and lines show data types
  7. Why is a structured approach easier to test than one large program?

    • The whole program must be tested at one time, so no module can be checked on its own at all
    • Each module can be tested on its own before the whole program is assembled
    • Structured programs have no inputs to test, because all of the values are fixed in the code
    • Testing is not needed for structured programs, because the structure guarantees correct results
  8. A hierarchy chart has a module called calculateTotal at the second level. Which level is it at relative to the main module?

    • The same level as the main module
    • It is not part of the chart
    • Two levels above the main module
    • One level below the main module
  9. A module in a hierarchy chart is called by two different parent modules. What does this indicate?

    • The chart contains an error that must be removed, since each module should have only one parent
    • The module is reused, so it is shared by more than one caller
    • The module is a variable and not a subroutine, so it can be read by both parents as a value
    • The module runs twice as often in the program, because each caller starts its own copy of it
  10. Which problem does a hierarchy chart help to show when a program is being designed?

    • Which subroutines are needed and how control passes between them
    • The speed of the network connection, which the chart records against each module's calls
    • The exact colour of each button in the interface, which is shown in full on the chart
    • The memory address of each variable, which the chart lists beside each module's box
  11. A programmer decomposes a payroll program into modules: get hours, calculate pay, print slip. What is this an example of?

    • Exception handling
    • Random number generation
    • Object-oriented inheritance
    • Decomposition into subroutines
  12. Why is a single responsibility per module considered good design in a hierarchy?

    • It removes the need for parameters, because each module reads all of its data from globals
    • It guarantees the program has no subroutines, so the whole design is a single large module
    • It forces each module to do many jobs at once, so fewer modules are needed in the design
    • It keeps each module focused, so it is easier to understand, reuse and test
  13. A design has an input module that gathers data, a processing module, and an output module, all called from the main module. Which design is this?

    • A procedural, top-down structure
    • A purely object-oriented class hierarchy
    • A random number generator
    • A single long sequence with no subroutines
  14. Which term describes a module that performs a task and returns no value to its caller?

    • Constant
    • Procedure
    • Record
    • Function
  15. A hierarchy chart shows a module with no boxes beneath it. What does that suggest?

    • It is a class with inherited methods
    • It is an error in the chart that must be removed
    • It is a lowest-level module that performs its task directly
    • It is the main program with no subroutines
  16. A team needs to change how the output module displays results. Which benefit of the structured approach applies?

    • Only the output module needs to change, leaving the others alone
    • The input module must be deleted, so that the new display can take over its place in the design
    • The main module must store the new display, so every other module is changed to call it
    • Every module must be rewritten from the beginning, since a change to one affects all of the others
  17. Which phrase best describes the relationship between the main module and its called subroutines in a hierarchy chart?

    • The main module is called by every subroutine, so control always starts in the lowest module
    • There is no relationship between them, because each subroutine runs independently of the main module
    • The subroutines are always placed above the main module, so the main module sits at the bottom
    • Control passes from the main module down to the subroutines, which return control to it
  18. A procedural program of 2000 lines is split into 20 modules. Which benefit is most directly gained?

    • The program will run 20 times faster
    • The 20 modules remove the need for any input
    • The program no longer needs variables
    • Each module can be understood and tested in isolation
  19. Which statement best explains why structured programming uses a top-down approach?

    • Starting at the overall task makes the main structure clear before details are added
    • It is required by all modern programming languages, so every program must follow this order
    • It avoids the need for a design phase, because the code is written straight away in full detail
    • It makes the smallest subroutines the most important, so they are designed and built first
  20. A hierarchy chart is redrawn to add a new module under an existing one. What does this show?

    • The design is refined by adding a new level of detail
    • The design is abandoned and restarted from zero
    • The main module has been deleted
    • A new class has been defined with inheritance

All AQA Computer Science quizzes