<commit_before># # OO Basics: Student
#
# # I worked on this challenge with Katherine.
# # This challenge took me [#] hours.
#
# # Pseudocode
#
#
#
# # Initial Solution
#
class Student
  attr_accessor :scores, :first_name

  def initialize(student_arguments)
    @first_name = student_arguments[:first_name]
    @scores = student_arguments[:scores]
  end

  def average
    scores_sum = 0
    @scores.each {|num| scores_sum += num}
    average = scores_sum/5
  end

  def letter_grade
    average
    if average >= 90
      letter = "A"
    elsif average >= 80
      letter = "B"
    elsif average >= 70
      letter = "C"
    elsif average >= 60
      letter = "D"
    else
      letter = "F"
    end
  end
end #For class


alex = Student.new({first_name: "Alex",
        scores: [100,100,100,0,100]})

jackie = Student.new({first_name: "Jackie",
        scores: [50, 50, 50, 50, 50]})

kat = Student.new({first_name: "Katherine",
        scores: [100, 80, 70, 60, 50]})

john = Student.new({first_name: "John",
        scores: [100,70,100,0,100]})

tony = Student.new({first_name: "Tony",
        scores: [100,60,100,0,100]})

students = [alex, jackie, kat, john, tony]
#LINEAR SEARCH
  def linear_search(array, first_name)
      index = 0
      if array[index].first_name == first_name
        return index
      index += 1
      else
        -1
      end
    end


# Refactored Solution
class Student
  attr_accessor :scores, :first_name

  def initialize(student_arguments)
    @first_name = student_arguments[:first_name]
    @scores = student_arguments[:scores]
  end

  def average
    scores_sum = 0
    @scores.each {|num| scores_sum += num}
    average = scores_sum/5
  end

def letter_grade
    case average
    when 90..100 then letter = "A"
    when 80..89 then letter = "B"
    when 70..79 then letter = "C"
    when 60..69 then letter = "D"
      else letter = "F"
    end
  end
end # For class

alex = Student.new({first_name: "Alex",
        scores: [100,100,100,0,100]})
<commit_msg>Update case language<commit_after># # OO Basics: Student
#
# # I worked on this challenge with Katherine.
# # This challenge took me [#] hours.
#
# # Pseudocode
#
#
#
# # Initial Solution
#
class Student
  attr_accessor :scores, :first_name

  def initialize(student_arguments)
    @first_name = student_arguments[:first_name]
    @scores = student_arguments[:scores]
  end

  def average
    scores_sum = 0
    @scores.each {|num| scores_sum += num}
    average = scores_sum/5
  end

  def letter_grade
    average
    if average >= 90
      letter = "A"
    elsif average >= 80
      letter = "B"
    elsif average >= 70
      letter = "C"
    elsif average >= 60
      letter = "D"
    else
      letter = "F"
    end
  end
end #For class


alex = Student.new({first_name: "Alex",
        scores: [100,100,100,0,100]})

jackie = Student.new({first_name: "Jackie",
        scores: [50, 50, 50, 50, 50]})

kat = Student.new({first_name: "Katherine",
        scores: [100, 80, 70, 60, 50]})

john = Student.new({first_name: "John",
        scores: [100,70,100,0,100]})

tony = Student.new({first_name: "Tony",
        scores: [100,60,100,0,100]})

students = [alex, jackie, kat, john, tony]
#LINEAR SEARCH
  def linear_search(array, first_name)
      index = 0
      if array[index].first_name == first_name
        return index
      index += 1
      else
        -1
      end
    end


# Refactored Solution
class Student
  attr_accessor :scores, :first_name

  def initialize(student_arguments)
    @first_name = student_arguments[:first_name]
    @scores = student_arguments[:scores]
  end

  def average
    scores_sum = 0
    @scores.each {|num| scores_sum += num}
    average = scores_sum/5
  end

def letter_grade
    case average
    when 90..100 then "A"
    when 80..89 then "B"
    when 70..79 then "C"
    when 60..69 then "D"
      else "F"
    end
  end
end # For class

alex = Student.new({first_name: "Alex",
        scores: [100,100,100,0,100]})

{'fraction_non_alphanumeric': 0.1238023197175996, 'fraction_numerical': 0.05194150277357539, 'mean_word_length': 2.7248826291079813, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5615314', 'n_tokens_mistral': 1561, 'n_tokens_neox': 1364, 'n_words': 381}