Complete the code to define an instance method named greet inside the Person class.
class Person def [1] puts "Hello!" end end
greet as specified. This defines an instance method that can be called on Person objects.Complete the code to call the instance method greet on the person object.
person = Person.new
person.[1]greet, use person.greet.Fix the error in the instance method definition by completing the method name correctly.
class Animal def [1] puts "I am an animal" end end
speak is the correct conventional name here.Fill both blanks to define an instance method age_in_dog_years that returns the age multiplied by 7.
class Dog def [1] @age [2] 7 end end
age_in_dog_years and the multiplication operator * is used to multiply age by 7.Complete the code to define an instance method full_name that returns the first and last name joined with a space.
class User def [1] "#{@first_name} #{@last_name}" end end
+ or - instead of space.full_name returns the first and last name joined by a space using string interpolation.