|
hey guys i have to make a program without arrays the program is:
Interstate Motorway Pty Limited requires you to design a program that will produce customer statements for passing through E-way checkpoints of four toll stations (denoted by A, B, C and D respectively) distributed on the nationwide motorway. The charge of each pass is specified as follows
Station A B C D
Charge $2.20 $2.80 $2.30 $3.80
These statements will be calculated from the checkpoint log file of the format
3435344 A 2005/02/22/08:22:41
4749038 A 2005/02/25/14:16:35
5186936 C 2005/02/28/08:34:53
3873242 D 2005/03/02/02:40:59
4749038 A 2005/03/05/14:16:35
4092191 A 2005/03/08/23:49:08
3435344 C 2005/03/11/08:22:41
4092191 C 2005/03/14/23:42:08
4749038 D 2005/03/17/14:16:35
3435344 A 2005/03/20/08:22:41
...
where the first column contains customer ids, the second column contains the toll stations and the last column contains the timestamps. Hence the first record in the above, for instance, indicates that the vehicle with tag number (i.e. customer id) 3435344 passed through toll station A at time 08:22:41 on 22nd February 2005.
In order that each statement carries also the customer's name and address, the address file will be provided in the form of
3435344 @ L Brooks,12 Shaftsbury Road,Burwood NSW 2134
3873242 @ N McGoldrick,8 Colless Place,South Melbourne VIC 3205
4092191 @ T Peachey,32 Evan Street,Penrith NSW 2750
4749038 @ D Merritt,70 Albert Street,Werrington NSW 2747
4967987 @ R Bailey,102-47 Pardalote Avenue,Glenmore Park NSW 2745
5186936 @ S Galloway,8-121 Coreen Road,Scoresby VIC 3179
...
For the convenience of processing the log file for the statements, the address file and the log file will be first merged and then sorted line by line alphabetically to generate the toll data file, which will thus look like
3435344 @ L Brooks,12 Shaftsbury Road,Burwood NSW 2134
3435344 A 2005/02/22/08:22:41
3435344 A 2005/03/20/08:22:41
3435344 B 2005/03/23/18:22:41
3435344 B 2005/04/10/28:22:41
3435344 C 2005/03/11/08:22:41
3435344 C 2005/05/10/14:22:41
3435344 C 2005/05/19/06:22:43
3435344 D 2005/05/01/01:26:41
3873242 @ N McGoldrick,8 Colless Place,South Melbourne VIC 3205
3873242 B 2005/03/29/02:40:59
3873242 B 2005/05/16/02:40:59
3873242 C 2005/04/07/22:40:59
3873242 D 2005/03/02/02:40:59
i can make it with arrays but i have no idea how to make it without arrays can someone please help me... much appreciate boys...
dez
|
|
|
|
|
|
|
|