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