This assignment involves writing scripts in Ruby to help you become familiar with the Ruby programming language.
Click the link to go to the starter repository. After forking this repository, follow these commands to get started:
git clone <https://github.com/your_username/fa19-hw2>
cd fa19-hw2
If you have not been able to download Ruby on your local computer, you can do the assignment with repl.it
There is a method called squared_sum
in hw2.rb. squared_sum
accepts two integer parameters a and b. The method should calculate the sum of a and b and then return the square of the sum. Please finish this method.
There is a method called sort_array_plus_one
in hw2.rb. sort_array_plus_one
accepts an array of integers as its parameter. The method should sort the given array, increment each element by 1, and finally return it.
Please finish this method, either in a destructive or non-destructive fashion.
There is a method called combine_name
in hw2.rb. combine_name
accepts two string parameters first_name and last_name. The method should return the first_name concatenated with the last_name with a space in between. Please finish this method.
<aside> 💡 Example: combine_name 'Ethan', 'Lee' => 'Ethan Lee'
</aside>