Programming is all about solving problems. How do you take a certain input and produce a certain output in response? Being able to figure this out is the key to being a good programmer.
An important task in doing this is being able to identify the structure of the problem. You need to be able to break it down into its simplest form and solve each of these smaller problems.
In this lesson, we’ll learn about:
In order to understand the structure of a problem, and design an algorithm to solve that problem, you need to identify the inputs, processes, and outputs of it.
Imagine we’re designing an algorithm for your school’s system that tracks and monitors student data, including attendance, punctuality and recording homework marks. Such systems are known as Information Management Systems (IMS).
Using this system, the teacher will need to log in using a username and password.
The teacher will then enter a surname and be given a list of matching students from which they need to select the correct one. Once they select a student, the student’s ID will be used to display the full details.
You need to identify the type and values of the data. These can correspond to NOUNS in a problem statement e.g. “search by SURNAME” indicates a noun input.
First is a username and password, they will be a value as words or words and numbers.
Then there is the student surname, this will be words, this is shown in figure 1 below.
Finally, there will be the student ID selected from the list, this is shown in figure 2 in the next section.
Last lesson you broke down the problem of creating a Student Planner.
Can you identify the inputs you’ll need for this?
Processes are the actions being performed on the inputs.
Are there any calculations, or are there any other computational operations going on? These usually correspond to verbs in a problem statement e.g. “SEARCH by surname” indicates a verb process.
In our example, the username and password will be used to search the database to see if there is a match.
The student name will be used to search the databases to see if there are any matches.
The selected student ID will be used to search the database to retrieve the student details. This can be seen in figure 2 below.
Last lesson you broke down the problem of creating a Student Planner.
Can you identify the processes you’ll need for this?
This is about what information will be presented to the user after the processing is complete. Much like with inputs, you need to identify the type and values of the information being outputted.
In our example, the first output will be either a confirmation or rejection of the teacher login.
The second output will be a list of students with a matching surname to the input. This is shown in figure 1 above.
The final output will be the contact details of the student selected from the list, shown in figure 2 above.
Last lesson you broke down the problem of creating a Student Planner.
Can you identify the outputs you’ll need for this?
So to summarise what we’ve learnt in this lesson: