Skip to content

Instantly share code, notes, and snippets.

@laurenkruczyk
Last active August 29, 2015 13:56
Show Gist options
  • Save laurenkruczyk/9175223 to your computer and use it in GitHub Desktop.
Save laurenkruczyk/9175223 to your computer and use it in GitHub Desktop.
*Note: I realize that this program does not run properly. However, I tried my best and after numerous attempts and changing/editing until it looked completely different from original form, I could not figure out how to properly fix the errors in my code. If help is available after submission, I would love some assistance with fixing my code. Th…
score_set_1 = [75, 100, 85, 65, 84, 87, 95]
score_set_2 = [98, 48, 67, 79, 82]
score_set_3 = [55, 97, 61, 83]
score_set_4 = [99, 71, 82, 87, 60]
all_score_sets = [[score_set_1], [score_set_2], [score_set_3], [score_set_4]]
def avg (all_score_sets)
avg= ((sum += all_score_sets.each)/(all_score_sets.each.length))
end
def high (all_score_sets)
high= (0..100).max
end
def low (all_score_sets)
low= (0..100).min
end
all_score_sets.each do |avg, high, low|
puts "The average score is #{avg}."
puts "The highest score is #{high}."
puts "The lowest score is #{low}."
end
puts all_score_sets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment