Created
May 27, 2015 13:47
-
-
Save philemonlloyds/2fd90b07c83aafe38cc9 to your computer and use it in GitHub Desktop.
Price quote for sign shop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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