Modelling Motorway Toll Charging

Authors Avatar
Computer Science 111 Third Coursework Problem

Motorway Toll Charging

Problem

The M111 is a newly opened toll motorway, with eight junctions at which the entry and exit of vehicles from the M111 is monitored. I must design and implement a program that can read the tolls data from a file and process the information to produce a table of users for that week and a summary.

Form of Data Input

tollsinfo file input

Gravelly L123ABC J 23 15 30

Ashton ABN1123 J 11 0 56

. . . . . .

. . . . . .

. . . . . .

. . . . . .

Fratton L123ABC L 1 12 31

Form of Data Output (Results)

Registration trips in wk tolls due speeding violations total due

Number serious dangerous

_______________________________________________________________

L123ABC 7 11.76 1 0 31.76

***********************Summary***********************

Total revenue for week was £1129.23

Total number of different users was 24

Total number of peak journeys was 45

Total off peak journeys was 65

Total number of serious speeding was 11

Total number of dangerous speeding was 8

Top Level Design

While not end of file do

Initialise variables

Read record..........................................................................................A

Search for record................................................................................B

If not found then create new.............................................................C
Join now!


Else update..............................................................................D

End do

Produce table.................................................................E

Produce summary......................................................F

Global Variables

Owner_Record:records used to store each users details in

Temp_Record:Car_Owner_details single record for transferring

counter:Integer counter for number of different users

Char:Character used to read in character

T_Distance:Float used to store total seconds

Position:integer used to indicate record position in array

O_Distance:Float used to transfer single user distance

Peak,Offpeak:Integer calculates peak and off peak users

T_Seconds:Integer stores time user was on motorway

Refinement of Top Level Design

A:

Procedure ...

This is a preview of the whole essay