Skip to content

Instantly share code, notes, and snippets.

@nikasulo
Last active April 22, 2021 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikasulo/4f147e2149aa97266cfbb17c5c118fbf to your computer and use it in GitHub Desktop.
Save nikasulo/4f147e2149aa97266cfbb17c5c118fbf to your computer and use it in GitHub Desktop.
def display_billable_hours(entries)
entries.each do |key, value|
puts "#{key}:"
puts value
end
end
def handle_input
days = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
entries = {}
days.each do |day|
while true
p "Enter your invoice number for #{day}:"
invoice_number = gets.chomp
break if invoice_number.length > 0
end
while true
p "How many hours did you work on #{day}?:"
hours_worked = gets.chomp
break if hours_worked.length > 0
end
entries[day] = "##{invoice_number} - #{hours_worked} Hours"
end
entries
end
def do_audit
entries = handle_input
display_billable_hours(entries)
end
do_audit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment