Professional Documents
Culture Documents
2.1.3. Thinking Procedurally
2.1.3. Thinking Procedurally
www.pmt.education
Specification:
2.1.3 a)
● Identify the components of a problem
2.1.3 b)
● Identify the components of a solution to a problem
2.1.3 c)
● Determine the order of the steps needed to solve a problem
2.1.3 d)
● Identify sub-procedures necessary to solve a problem
www.pmt.education
Identify the components of a problem
The first stage of thinking procedurally in software development involves breaking down
the problem into its component parts, in a process called problem decomposition. In this
process, a large, complex problem is continually broken down into smaller subproblems
which can be solved more easily. The project also becomes easier to manage and can be
divided between a group of people. This requires software developers to consider a
problem in terms of the underlying subproblems that need to be solved to achieve the
desired result.
This is the stage in which the details about how each component is implemented are
considered.Just as we broke down the problem, we must now build up to its solution.
www.pmt.education
Going back to our previous example involving the book reservation system, we need to
consider the lowest-level components and how they can best be solved.
Borrower name
This could be implemented as a procedure, getName() ,
which checks to see whether or not a user is signed-in to
their library account. If they are already signed-in, their
name can be retried by querying the library’s database of
users for the name of the borrower associated with the
borrower’s ID. Users that are not signed-in should be
redirected to a page, requesting them to either register or
sign-in. These options should redirect the user to the
relevant form.
Book details
The user should be able to enter the name of the book into
a text entry field, which would display the books stocked by the group of libraries. This
could be implemented as a function which returns the ISBN of the selected book, which is
easier to handle and can be more useful than a string.
Collection location
This input could also be implemented as a function, which returns the location specified by
the user. It is impractical to use a text entry field here, as this raises the likelihood of
erroneous data being entered, such as a location where a library does not exist. Therefore,
this data is best collected through a drop-down field in a form.
www.pmt.education
Order of steps needed to solve a problem
When constructing the final solution, thinking about the order in which operations are
performed becomes important. Some programs might require certain inputs to be entered
by the user before the processing can be carried out. These inputs would need to be
validated before they can be passed onto the next subroutines, which must also be taken
into consideration.
The same principle is important when considering how a program will be used. Programs
should be built so as to ensure operations are not carried out in an order that will raise an
error. Consider an adventure game. It should not be possible for users to access and play
levels ahead of those they have unlocked. A fast food delivery app should not allow users
to select food until they have confirmed their location, nor should it allow users to pay
before they have confirmed their order.
www.pmt.education