Professional Documents
Culture Documents
Chapter 4
Chapter 4
Complete this flowchart which will allow the input of ten numbers.
• A number is even if the number divided by 2 is an integer.
• If a number (N) is odd, it will be added to the odd total (OT).
• If a number (N) is even, it will be added to the even total (ET).
• Both these totals will be output after the tenth number has been processed.
2023/m/12 10 Gustav has started to write an algorithm using pseudocode. It will input 6 numbers, all
less than
1000, and output the smallest value.
Complete the algorithm using pseudocode.
count 0
smallest 1000
WHILE count < 6
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
....................................................................................................................................................................
.............................................
.............................................................................................................................................. [6]
11 In Ruritania these are the tax rules.
• People who earn up to $10000 pay no tax.
• People who earn between $10000 and $40000 pay 20% tax on their earnings above $10000.
• People who earn more than $40000:
pay $6000 ($30000 × 20%)
and pay 40% tax on their earnings above $40000.
Complete this flowchart which shows how the net wage (the money earned after tax is paid) is
calculated and is output for an individual in Ruritania
2023/f/12 4 Mark has a small glasshouse. He lives in a warm country where plants can die if they are
left without water for too long. The glasshouse has a microprocessor controlled sprinkler system and a
moisture sensor in the soil.
Complete this flowchart to show the processing required to control the level of moisture in the soil of
the glasshouse. You may assume that a pre-set value, dry, has already been input so that the system
can test if the amount of moisture in the soil has reached or fallen below a certain level.
The user activates the microprocessor system by pressing a switch.
(a) Complete the flowchart which inputs the moisture reading in the glasshouse and switches the
sprinkler on and off according to this value. It also checks if the sprinkler is already on or off before
attempting to switch it on or off.
(b) Flowcharts often contain subroutines.
(i) Draw the symbol used to represent a subroutine in a flowchart.
[1]
(ii) State what you would expect to see in the first box of a subroutine.
...........................................................................................................................................
..................................................................................................................................... [1]