AQA Computing CPT3 June 08 Peter's Petrol Pumps

Authors Avatar


Peter’s Petrol Pumps- Module 3

Alex Sheppard

Design

Introduction

Petrol stations usually show prices and amount of petrol dispensed on each petrol pump and also have a console in the office showing information about each sale from each petrol pump on the garage forecourt.

The pump shows how much petrol has been sold, the price per litre in pence to one decimal place and the total amount to pay. The console also displays this information for each pump.

Peter owns a petrol station with one petrol pump. Every day he needs to know the number of litres of petrol that are sold and the total amount of money taken for the pump.

A program is required to simulate the display on the pump and on the console for the 1 pump.

Data Requirements

User Interface


Main Form

This form will be shown first when the program is run. It will be split in 2, with the pump on 1 side and the console on the other side. For security reasons, the console will not be shown without a password being entered to unlock it. Most of the functions will be carried out from this form, such as filling the car with petrol and Peter using the console functions.


Login Form

When the user wishes to access the console, this dialog will be shown and allow the user to enter a password, that will unlock the console if the password entered is correct. When main form is loaded, the console will be hidden.


New Price per Litre

This dialog will be shown when the user wishes to change the price per litre. It will allow the user to enter the new price in pence, which will then put onto the pump LCD and onto the console display.


Structure Chart

Pseudocode Algorithms

Pump Operation

Event: Clicking Remove / Replace Nozzle Button

If Button says Remove then

Button says Replace

On Console Zero Dispensed Button is enabled

If Button says Replace then

        Button says Remove

        Button Squeeze is disabled

        On Console Pump is marked out of use

        Petrol Dispensed, Price and Number of Customers increase accordingly

Join now!

End If

Event: Clicking Squeeze / Stop Squeezing Nozzle Button

                If Button Says Squeeze then

                        Button says Stop Squeezing

                        Button Nozzle is disabled

                        Timer is enabled

                        On Console State of Pump = In Use

                If Button says Stop Squeezing then

                        Button says Squeeze

                        Button Nozzle is enabled

                        Timer is disabled

                End If

Console Operation

Event: Clicking Zero Petrol Dispensed Button

                On Pump, Number of Litres and Amount to Pay are set to 0

                On Console, Number of Litres and Amount to Pay are set to 0

Pump = Ready for Use

On Pump, Squeeze Nozzle Button is enabled

...

This is a preview of the whole essay