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

Variable Name

Data Type

Description

Example

Validation

LitresDispensed

Single

Stores the number of litres the customer has put in their vehicle

45.6

Range

Format

PerLitre

Single

Stores the price per litre

09.9

Format

Presence

AmountToPay

Single

Stores the amount the customer has to pay

76.54

-

TotalPetrol

Single

Stores the amount of petrol sold in the day

567.8

-

TotalTakings

Single

Stores the amount of money taken in the day

£501.23

-

NoOfCustomers

Single

Stores the number of customers that have used the pump in the day

1

-

Password

String

Stores the password required to unlock the console

password123

Presence

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
Join now!


On Console Pump is marked out of use

Petrol Dispensed, Price and Number of Customers increase accordingly

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 ...

This is a preview of the whole essay