Pascal Progress
Just another WordPress.com weblog

Feb
01

Actions

0819

  • display of one petrol pump only and the console
  • amount of petrol sold in tenths of a litre
    • Litres – xx.x
  • amount to be paid in pounds and pence
    • Amount to pay – £ xx.xx
    • Pence per liter –    xxx.xx
  • petrol pump uses seven segment LCDs
  • need to write and test a procedure to display a number as a seven segment figure
  • The console must also display the total amount of money taken but does not need to use an LCD

Peter’s options

  • Set Price per litre (in pence)
  • Change Price per litre (in pence)
  • Reset over all amount of petrol dispensed
  • Reset amount of petrol dispensed after every transaction
  • Reset overall amount taken
  • Reset amount paid after every transaction
  • View total taking for that day
  • View amount of petrol sold for that day

Customers actions

  • Remove the nozzle
  • Squeeze the nozzle
  • Stop squeezing
  • replace the nozzle

Customer Display (Petrol Pump)

Should display in 7segment LCD

  • Current Price : Pence per litres
  • Amount of petrol dispensed : Litres (1dp)
  • Amount to pay: Pound and Pence

Amount of petrol dispensed and amount pay will remain untilled zeroed by Peter.

  • Petrol dispensed : 0.5 – 100 litres in tenths of a litre
  • Price per litre can be up to : 199.9 pence per litre

Peter’s Display (Console Display)

  • State of the pump (Ready to use | In use | Out of order)
  • Amount of petrol dispensed : Litres (1dp)
  • Amount to pay: Pound and Pence

When nozzle replaced:
Amount of petrol dispensed + Total amount for the day
Amound paied + Total amount for the day (From all the sales that day)

Flagged out of order: Until number of litre dispensed is zero on the Pump and Console

Jan
31

19.2 Background

 0801

Petrol stations selling petrol 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.

Each petrol 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 small petrol station with one petrol pump. Every day Peter needs to know the number of litres of petrol that are sold and the total amount of money taken for the pump.

You have been asked to write a PROGRAM to simulate the display

on the pump and on the console. The system you are to develop is simplified and should not include details about taking money from the customers but just assume that the amount displayed is the amount of money received. Also you are not required to test for the customer.s petrol tank overflowing when the petrol is being dispensed.

19.3 Specification

1. You have been asked to write a program to simulate the display of one petrol pump only and the console. The program needs to record the amount of petrol sold in tenths of a litre and the amount to be paid in pounds and pence every time the pump is used.

The display on the petrol pump uses seven segment LCDs (Liquid Crystal Displays). As part of your programming you will need to write and test a procedure to display a number as a seven segment figure. The console must also display the total amount of money taken but does not need to use an LCD.

XX.XX Amount to Pay (£ p)

XX.X Litres

XXX.X Pence per litre

Note to teachers: if a candidate is unable to write a procedure to simulate a seven segment LCD display successfully, a simplified display could be programmed but the candidate may be unable to provide appropriate evidence to answer some questions set in the examination.

 

2. Peter at the console can:

• set and change the price per litre in pence

• zero the amount of petrol dispensed (this will also automatically zero the amount paid)

• view the total takings and total petrol sold

• set the total takings and total petrol sold to zero at the beginning of each day.

 

3. The customer buying petrol can:

• remove nozzle from holster to indicate they are ready to buy petrol

• squeeze the nozzle to put petrol in the tank

• stop squeezing the nozzle to stop putting petrol in the tank

• replace the nozzle to finish putting petrol in the tank

Each of the above can be simulated by keystrokes or the use of a button or similar.

 

4. The petrol pump displays:

• the current price in pence per litre to 1 decimal place as seven segment LCDs

• the amount of petrol dispensed at any time as seven segment LCDs showing the number of litres to one decimal place. This display remains after the petrol has been dispensed until zeroed by Peter from the console.

• the amount to be paid at any time as seven segment LCDs showing the amount in pounds and pence. This display remains after the petrol has been dispensed until the number of litres of petrol dispensed has been zeroed by Peter.

The pump can dispense between 0.5 and 100 litres in tenths of a litre. The price per litre can be up to 199.9 pence per litre.

 

5. The console displays:

• The state of the pump:

· ready for use (display set to zero customer can start putting petrol in the tank)

· in use

· out of use (waiting for Peter to zero the display)

• the amount of petrol being dispensed by the pump when it is

in use, showing the number of litres to one decimal place. This display remains after the petrol has been dispensed until zeroed by Peter.

• the amount to be paid when the pump is in use in pounds and pence. This display remains after the petrol has been dispensed until the number of litres of petrol dispensed has been zeroed Peter.

When the nozzle is replaced in the holster the amount of petrol dispensed is added to the total amount for that day, and the amount paid is added to the total amount paid from all the sales that day. The pump is flagged as out of use until the number of litres dispensed is zeroed on the pump and the console, it is then set as ready for use by the next customer.

 

Testing 6. Candidates will need to design and use test data, including boundary values, to test the following:

• the correct working of the seven segment LCDs on the petrol pump

• the correct working of the console display

• a day.s operation of the petrol pump that simulates at least seven customers buying petrol

• that the displays on the console and the LCDs on the petrol pump match

• resetting the pump after each purchase

• setting the daily totals on the console to zero at the start of the day

• changing the price of a litre of petrol

The console display and the LCDs for the pump can appear on the

same screen for testing purposes.

 

19.4 Requirements of the Practical Exercise

Candidates will need to design and implement an appropriate computing system and provide sufficient documentation to demonstrate the following practical skills:

• Design

• Implement/Test.

The task may be undertaken by writing a program in a chosen high level language.

Candidates are expected to produce brief documentation including some or all of the following, as appropriate.

 

Design

• Definition of data storage requirements

• User interface design for console and petrol pumps

• Algorithms for

• pump operation

• console operation

• simulating the seven segment LCD display

• production of daily totals

Jan
31

Pascal Project - Shovan Sargunam

Hello readers, I am Shovan. I have dedicated this blog for my college project on Pascal software. This is basically my course work and I shall update its regularly (hope so :p )

Have fun reading, and don’t forget to leave your foot prints with your valuable and use full comments. This will (might) motivate me

Enjoy

Shovan
https://pascalproject.wordpress.com/

Share this post :

Jan
31

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!