Guest User

Untitled

a guest
Jan 24th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. A Day as an Assistant
  2.  
  3. It's your lucky day! While strolling in the flea market, you stumble upon a curious, oriental looking lamp. On the spur of the moment you decide to buy it - after all, it costs only five euros. Afterwards, when you are cleaning your purchase at your house by rubbing it with a cloth, a genie appears from the lamp and promises to fulfill one of your deepest wishes, but only one of them. You know immediatly what to wish for: to become an assistant of the elementary programming course! One poof, and instatly you seem to have gain an aura of wisdom and style that shines to the people . Oh the happiness! But what is this!? As soon as you open your e-mail, you discover that you have received mail from Jukka Riekki. He has created files that contain the grades of the students, who participated in the course, and wants you to write copies of them that are much cleaner, easier to read and contain less redundant information. Work! This is all that being an assistant is!? you cry out loud and start to design a Python program, which would perform this terribly dull task for you...
  4.  
  5. Instructions
  6.  
  7. Your program must read the contents of the input file grading_in.txt.
  8. The program must write its output into a file grading_out.txt based on the info received from the input file.
  9. The outputs must be exactly of the form that is shown in the examples (see below).
  10. We will assume that the input files are always of the form shown in the examples (see below).
  11. Because of this, you do NOT need to check if the file that your program reads is somehow corrupted!
  12. Your program does not have to and must not print anything.
  13. Example input files and output files
  14.  
  15. Input file
  16.  
  17. 521141P - Elementary Programming, Grading
  18.  
  19. Student : Lecture assignments: Programming Exercises : Final Exercise : Total Score : Grade
  20. Keke Koodari : 5 : 10 : 20 : 35 : 3
  21. Yky-Pertteli Eskonpekka : 10 : 15 : 24 : 49 : 5
  22. Taavetti Tautinen : 10 : 15 : 4 : 29 : 2
  23. Quentin Quitegood : 9 : 13 : 22 : 44 : 4
  24. Paavo Poloinen : 8 : 3 : 10 : 21 : h
  25. Justiina Yli-Rima : 6 : 7 : 13 : 26 : 1
  26. Output file
  27.  
  28. 521141P - Elementary Programming, Grading
  29.  
  30. Keke Koodari............................3
  31. Yky-Pertteli Eskonpekka.................5
  32. Taavetti Tautinen.......................2
  33. Quentin Quitegood.......................4
  34. Paavo Poloinen..........................h
  35. Justiina Yli-Rima.......................1
  36.  
  37. Autumn 2011
  38. Input file
  39.  
  40. 521141P - Elementary Programming, Grading
  41.  
  42. Student : Lecture assignments: Programming Exercises : Final Exercise : Total Score : Grade
  43. Bill Gates : 8 : 14 : 22 : 44 : 4
  44. Steve Jobs : 10 : 11 : 16 : 37 : 3
  45. Mark Zuckerberg : 4 : 15 : 15 : 34 : 2
  46. Alan Turing : 10 : 15 : 25 : 50 : 5
  47. Output file
  48.  
  49. 521141P - Elementary Programming, Grading
  50.  
  51. Bill Gates..............................4
  52. Steve Jobs..............................3
  53. Mark Zuckerberg.........................2
  54. Alan Turing.............................5
  55.  
  56. Autumn 2011
  57. Useful to remember
  58.  
  59. Read, write and append modes
  60. len() function
  61. String methods: Python Docs
  62. file.readline() and file.readlines() methods
Add Comment
Please, Sign In to add comment