+ 2

How would I solve this problem using an if statement. Please and Thank you.

require 'csv' total_sales = 0 CSV.foreach('sales-data.csv', headers: true, converters: :all) do |row| # TODO: check if category is "Music" (row[2]) # TODO: if it is music, add total_sales + the row's sales (row[6]) end puts total_sales.round(2)

24th Apr 2017, 3:39 AM
Andrew Jackson
Andrew Jackson - avatar
1 Answer
+ 1
If nobody knows here in sololearn, try using stack overflow website
13th May 2017, 2:15 PM
Hiro
Hiro - avatar