I am stuck on an assignment I am working on. To be honest, the way I've structured it, it goes a bit beyond me.
Can someone kindly assist?
I have to get the following text:
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
pipe it to a program that sorts the stations, date time, then outputs an invoice with total amount owing. (I have been told Station A costs 2.20, B costs 2.80 etc...)
I am in first year, first semester. So I have to use easy methods.
I have made functions which basically: initialise, printHeadings (such as customer name and ID), readRecords (id, date, time, station), process Record (get station, times quantity of times entered by relevant charge), printInvoice (total for each station, then total for invoice).
My first problem:
How do I read from this file data to store into arrays, the two separate types of line (ie one has address, other has station, date and time). Do I do this within the one function or split it up into 2 functions? (One line I will use for just typing up customer details, the other I will use further to calculate amount to invoice....
Thanks for your time.