Complete the code to declare a method named greet.
def [1] puts "Hello!" end
The method name should be greet as specified.
Complete the code to declare a method named add that takes two parameters.
def [1](a, b) a + b end
The method name should be add as specified.
Fix the error in the method declaration by completing the method name.
def [1](name) puts "Hello, #{name}!" end
The method name should be greet to match the usage.
Fill both blanks to declare a method that returns the square of a number.
def [1](num) num [2] 2 end
The method name is square and the exponent operator is ** in Ruby.
Fill all three blanks to declare a method that greets a person with their name and age.
def [1](name, age) puts "Hello, [2]! You are [3] years old." end
The method name is greet_person. Use Ruby string interpolation #{name} and #{age} to insert values.
