| CS182 -- Lab 4: Commute Time |
|
|
OverviewIn this lab, you should become proficient at file I/O. ProceduresSince June 25, 2002, I have recorded the amount of time it takes me to get to work. The file commute.txt contains my records for commute times. The first few lines of the file are included below: # If * after time then trip was not direct # If d after time then had accident or detour # If h after time then time is in hh:mm:ss format # Date Commute time to work # mm:ss.ms Tue Jun 25 10:39:06 2002 19:29.05 Wed Jun 26 10:25:32 2002 17:58.65 Thu Jun 27 09:42:47 2002 19:35.10 Fri Jun 28 10:44:14 2002 37:41.55* Lines that begin with a # symbol are comments and should be ignored. Comment lines may appear anywhere in the file (not just at the beginning). Each line containing a data point indicates the date of the commute and the time required for the commute. Typically the time is indicated in the following format: mm:ss.ms where mm represents minutes, ss represents seconds, and ms represents milliseconds. Three additional characters (*, d, and h) may appear after the time. Typically none of the characters appears; however, any combination of them may appear on a line. The order in which they appear may not be consistent. The meaning of the symbols is given in the comments at the beginning of the file. Write a program that will read the data file, calculate a number of statistics, and write them to an output file. Your output file should include the following statistics:
Just for funIf you are looking for an extra challenge you may want to include other statistics in your results (be sure to meet the minimum requirements before doing extra). There are lots of other things you could find, but here are some ideas:
Lab report (due 11:00pm, the day prior to week 6 lab)The lab report does not need to be self-contained. Your report should include:
As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well. Your grade will depend on quality of design, clarity of code and documentation, as well as whether your program produces the correct results. If you have any questions, consult your instructor. |
| © 2002 Dr. Christopher C. Taylor | Office: CC-27C | Phone: 277-7339 | Last Updated: Mon Jan 27 06:09:11 2003 |
| I am responsible for all content posted on these pages; MSOE is welcome to share these opinions but may not want to. | |||