- Use error messages to correct syntax mistakes and/or drive development
- Define a method's responsibility
You will run into numerous error messages as a developer, so it's important to know what they mean and how to read them. The messages provide valuable information on where your program is having problems, but sometimes the messages are misleading, especially if you have little practice interpreting them. In this challenge, you need to work through the error messages until the program runs properly.
Run the code from the console. You should encounter 5 errors before it will run completely (excluding the bonus - uncomment the line to work on it). Read each error carefully and fix it.
Ensure each method is working as expected. You may need to create or modify methods to make the program run properly.
Write tests using Driver Test Code or assert
statements (make sure you have your assert method defined!)
Interact with the code by writing at least three more different method calls. Did they return what you expected?
Release 5: Reflect
Uncomment the bonus section in the my_solution.rb file (except for the line that says bonus section) and write the code to make the driver code run as you would expect.