some useful things in Ruby I’ve discovered:
– Find your previous code cluttering up the Terminal window? Use ctrl + l to clear the window and start fresh!
– Want to break up a long string into multiple lines? (Without breaking up the output with line breaks.) Put a forward slash \ at the end of each line.
Here is my work for Exercise 12:
1. Try out the .to_f operation. What does .to_f do?
The .to_f method on a string returns the interpretation of the leading characters as a floating point number. Characters past the valid number characters are ignored. If no valid number is found at the beginning of the string, 0.0 will be returned.
2. To play with .to_f more, make a small script that asks for some money and gives back 10% of it. If I give your script 103.4 (dollars), your script gives me back 10.34 in change.