Data Classes • Exercise 3/3

Data Class with Derived Values

00:00
0
20 points

Instructions

Create a Person data class with first_name and last_name attributes.

Add a full_name method that returns "#{first_name} #{last_name}".

Also add an initials method that returns the first letter of each name.
Example: "John Doe" -> "JD"

Your Code

Results

Click "Run Tests" to see results