Clean movie ratings

Challenge
No

It's Wilde Week in goatville. The Wildes are like the Oscars, but for goat movies.

Download (that's a link) a data set on critic and viewer ratings of movies.

Each record has four fields:

  • Movie title. Must be present.
  • Genre (romance, action, or scifi). Must be one of the three values given. Extra leading/trailing spaces are OK. Upper/lowercase OK.
  • Critic rating, from 1 to 5. Must be an integer in this range.
  • Viewer rating, from 1 to 5. Must be an integer in this range.

Write a program to read the file, and compute the average critic and viewer for valid records. Also report the number of records and valid records.

Output should be like this:

  • Number of records read: 33
  • Number of valid records: 25
  • Average critic rating: 2.76
  • Average viewer rating: 3.28

Use at least three functions. I used four in my solution.

Upload a zip of your project folder. The usual coding standards apply.

Attachments
Where referenced