# Conditionals Practice

These exercises will be good practice for you if you want more practice with:
- creating logical boolean statements
- Ruby conditional syntax
- constructing code from a word problem


1. As a customer of a store, you are interested in the average cost of items that you've purchase from the store. The data you gather from the user is the total **number** of items you've purchased and the total **amount** of money you've spent so far. Be sure that your code will work even if the total number of items is zero!

1. Write a password guessing program to keep track of how many times the user has entered the password wrong. If it is more than 3 times, print "You have been denied access." and terminate the program. If the password is correct, print "You have successfully logged in." and terminate the program.

1. For some reason, your boss has given you an _odd_ arbitrary math problem to solve. First, you want to get a number from the user. Next, do some math! If the number is odd, change its value so that it is now 3 times it's original value plus 1, otherwise change its value so that it is now half of its original value.

1. As a customer of a craft store, write some code to determine the cost of fancy yarn based on the length someone desires. The user should provide the distance that they desire (in cm), and your code should return the total cost of the yarn based on the distance and the cost per cm. Use the following chart to determine the price:

| Distance (cm)     | Cost per cm    |
| :------------- | :------------- |
| 0 through 100       | $0.25       |
| More than 100 but not more than 500      | $0.20      |
| More than 500 but less than 1,000      | $0.15      |
| 1,000 or more      | $0.10       |
