Guest User

Untitled

a guest
Oct 17th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. class VideoPricer
  2.  
  3. def price(imdbId)
  4. price = 4.95
  5. rating = ImdbRatings.new().fetchRating(imdbId)
  6. #premium title
  7. if(rating >= 8.0)
  8. price += 1.0
  9. end
  10. #bargain bucket
  11. if(rating < 4.0)
  12. price -= 1.0
  13. end
  14. return price
  15. end
  16. end
  17.  
  18. class ImdbRatings
  19. def fetchRating(imdbId)
  20. # code to get rating from IMDB API
  21. end
  22. end
Add Comment
Please, Sign In to add comment