I have to write a program that will reformat the data files given to me and create a new data file for each city. The desired output would be the cities name followed by the year( fixed four digits), monthly rainfall-12 months(Jan-Dec), and total rainfall for that year(4 digit). In order to format the year I must drop the first 6 months of the first year and the last six months of the last year. Because its formatted as July through June. I don't know where to start.
Reformat file input/output
Collapse
X
-
Tags: None
-
Originally posted by tudyfruity18I have to write a program that will reformat the data files given to me and create a new data file for each city. The desired output would be the cities name followed by the year( fixed four digits), monthly rainfall-12 months(Jan-Dec), and total rainfall for that year(4 digit). In order to format the year I must drop the first 6 months of the first year and the last six months of the last year. Because its formatted as July through June. I don't know where to start.
What I can see from here is you can find the minimum year and then start by searching the 7th month and so on. Then when the maximum year comes just do the same upto 6th month.
Regards -
Originally posted by tudyfruity18I have to write a program that will reformat the data files given to me and create a new data file for each city. The desired output would be the cities name followed by the year( fixed four digits), monthly rainfall-12 months(Jan-Dec), and total rainfall for that year(4 digit). In order to format the year I must drop the first 6 months of the first year and the last six months of the last year. Because its formatted as July through June. I don't know where to start.Comment
Comment