in reply to hw question

Start by breaking down the steps:

  1. Open the log file
  2. For each line in the file, split into the pieces you need
  3. Calculate the online time
  4. Store the information you need in some type of data structure
  5. Close the log file
  6. For each login id
  7. For each month
  8. Print a report line

Once you have some code written and get stuck, come back, show us the code, and explain where you're stuck.

update - Also, see How do I post a question effectively? and Writeup Formatting Tips