Skip to main content

Cambridge IGCSE & O Level Computer Science Programming Book for Microsoft Visual Basic Sample

Page 46

We are working with Cambridge Assessment International Education towards endorsement of this title. Any references or material related to answers, grades, papers or examinations are based on the opinion of the author(s). CAMBRIDGE IGCSE™ & O LEVEL COMPUTER SCIENCE: PROGRAMMING BOOK

CONTINUED Any incorrect entry is shown the error message and redirected back to the INPUT symbol. This process will continue to repeat until two in range values are input. The result process shows the exact process to be completed and the final OUTPUT symbol defines the value to be output. Questions

LE

A scenario question is likely to use words to describe acceptable range values. You will be expected to use precise mathematical terms to define the range in a flowchart.

For the following scenarios, create an appropriate flowchart. Consider what inputs are required and what values need to be checked. Remember to be precise when defining the limits.

2

A

M

3

A roller-coaster has height and weight restrictions. To be able to ride the roller-coaster people must be at least 1.10 metres tall. The maximum weight a seat on the roller-coaster can safely hold is 125 kilograms. Only people who are within these limits will be permitted to rider the roller-coaster. A firm makes metal beams. Beams come in two strengths ‘standard’ and ‘extra strong’. The minimum length of beam they will make is 1 metre. A standard beam can be no longer than 4 metres, but an extra strong beam can be made in lengths up to 6.5 metres. Orders for beams outside of these limits will be rejected. All other orders proceed to a process called ‘Calculate Price’. A climate control system in a hospital operating theatre is required to maintain a constant temperature of 21° Celsius. A temperature sensor inputs the actual temperature in the operating theatre into the system. If the actual temperature drops below 20° Celsius, the heating must be on. If the actual temperature rises to 22° Celsius or more, the cooling system must be on. When the actual temperature is between these two limits both the heating and cooling system are off. Remember the temperature is constantly being checked.

P

1

2.4 Pseudocode

S

Pseudocode is a method of describing the logic and sequence of a system. It uses keywords and constructs similar to those used in programming languages but without the strict use of the syntax required by formal languages. It allows the logic of a system to be defined in a way that is independent of any specific programming language. Pseudocode can be understood by any programmer. This means that the final program can be coded using any programming language that is appropriate to the context. This is useful when designing programs as the code required to perform a particular process can vary considerably across differing programming languages. It also means that if there are multiple people working on a project, programmers from different programming language backgrounds can discuss and develop ideas and logic using a format common to them all.

KEY WORD pseudocode: a way of unambiguously representing the sequence and logic of a program using both natural language and code-like statements.

34 Original material © Cambridge University Press 2021. This material is not final and is subject to further changes prior to publication.


Turn static files into dynamic content formats.

Create a flipbook
Cambridge IGCSE & O Level Computer Science Programming Book for Microsoft Visual Basic Sample by Cambridge International Education - Issuu