Skip to content

Instantly share code, notes, and snippets.

@philemonlloyds
Created May 27, 2015 13:47
Show Gist options
  • Select an option

  • Save philemonlloyds/2fd90b07c83aafe38cc9 to your computer and use it in GitHub Desktop.

Select an option

Save philemonlloyds/2fd90b07c83aafe38cc9 to your computer and use it in GitHub Desktop.
Price quote for sign shop
def price_quote_for_sign(size,colors)
size_of_sign = size
number_of_colours = colors
total_cost_sign_before_tax = (15 * size) + (colors<=2?colors*10:colors*15)
calcutation_tax(total_cost_sign_before_tax)
end
def calcutation_tax(total_price_of_products)
tax_rate = 15
total_price_of_products += (total_price_of_products*tax_rate) /100.to_f
puts "Your quote for the requested sign is $ #{total_price_of_products}"
end
def quote_for_customer
puts "Please provide the size of your sign in sq.ft."
size_of_sign = gets.chomp.to_i
puts "How many colours would your sign contain?"
total_colors = gets.chomp.to_i
price_quote_for_sign(size_of_sign,total_colors)
end
quote_for_customer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment