Last active
September 4, 2020 15:17
-
-
Save CheezItMan/bcb24385b1fd93c22c24636a9cf9cb5b to your computer and use it in GitHub Desktop.
This file contains 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
# Review the code below | |
# What questions do you have? | |
# What happens if the commented lines | |
# are uncommented? | |
MY_EARNINGS = 10 | |
def sales_tax(amount) | |
# puts "tax = #{tax}" | |
# puts "amount = #{amount}" | |
puts "MY_Earnings is #{MY_EARNINGS}" | |
tax = amount * 0.08 | |
return tax | |
end | |
# puts tax | |
my_tax = sales_tax(MY_EARNINGS) | |
puts "My Sales tax is #{my_tax}" | |
# Identify: | |
# 1. Method Signature | |
# 2. Constant | |
# 3. Parameter | |
# 4. Argument | |
# 5. return value | |
# 6. Method body | |
# 7. Where do we invoke the method | |
# 8. What is the scope of "tax" | |
# 9. What will this return: | |
# true || false && true | |
# (3 + 7) ** 2 > 9 * 9 | |
# 10. Explain the difference between | |
# until loops and while loops |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment