An introduction to computers and computer systems
An introduction to computers and computer systems

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

4 Using flowcharts to describe a task 2

Now consider what happens when you are weighing, for example, flour on a set of scales. You slowly add more flour to the scalepan until you reach the desired weight. As you do this the display constantly changes, showing the weight increasing as you add more flour. To do this, the scales’ computer must repeatedly examine the input and update the display each time it does so. The flowcharts in Figures 1 and 3 do not implement this. They simply take one reading and need to be re-started to take another.

The flowchart can be changed so that the input is repeatedly examined and the output repeatedly displayed by means of what is called a loop. A loop allows a certain part of a flowchart to be carried out as many times as necessary depending on the results of a decision. In this instance, after every ‘send to the display’, the flowchart in Figure 4 shows a loop back to examine the sensor again, provided the scales have not been switched off. Note that a loop has to start as a branch from a decision box. Spend a few moments examining the loop in Figure 4; make sure that you understand how this flowchart differs from the one in Figure 3 and why it would enable the scales to display an increasing weight as, for example, flour was slowly added to the scalepan.

The steps in the flowchart are as follows: Start; Accept data from sensor; Examine metric/imperial button; Is weight to be shown in grams? For yes: ‘Transform sensor data to display gram format and for no: Transform sensor data to display in pounds and ounces format; Send data to display; Examine on/off button; Should scales be switched off? For yes: End and for no: Back to the start.
Figure 4 Flowchart for electronic scales incorporating a loop

Having seen how flowcharts can be useful to help understand the individual steps that make up a task, in the section, you will think about a more complicated example.

Take your learning further

Making the decision to study can be a big step, which is why you'll want a trusted University. The Open University has 50 years’ experience delivering flexible learning and 170,000 students are studying with us right now. Take a look at all Open University courses.

If you are new to University-level study, we offer two introductory routes to our qualifications. You could either choose to start with an Access module, or a module which allows you to count your previous learning towards an Open University qualification. Read our guide on Where to take your learning next for more information.

Not ready for formal University study? Then browse over 1000 free courses on OpenLearn and sign up to our newsletter to hear about new free courses as they are released.

Every year, thousands of students decide to study with The Open University. With over 120 qualifications, we’ve got the right course for you.

Request an Open University prospectus371