Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit, with a first pass at implementing the get_letter_grad… #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions letsdrill.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
def get_letter_grade(integer)

#Put your code here!

case integer
when 90..100
"A"
when 80..89
"B"
when 70..79
"C"
when 60..69
"D"
when 0..59
"F"
else
"Error: invalid input, \"#{integer}\" Grades must be between 0 and 100."
end
end

def shortest_string(array)

#Put your code here!

if array.any?
array.sort_by{|s| s.length}[0]
Copy link
Member

@jaybobo jaybobo Mar 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better. Thx.

end
end


Expand Down