Once there was an eccentric programmer living in a strange house with barred windows. One day he accepted a job from an online job board to build a party robot. The robot is supposed to greet people and help them to their seats. The first edition was very technical and showed the programmer's lack of human interaction. Some of which also made it into the next edition.
Implement the welcome method to return a welcome message using the given name:
PartyRobot.welcome("Christiane")
# => Welcome to my party, Christiane!Implement the happy_birthday method to return a birthday message using the given name and age of the person.
Unfortunately the programmer is a bit of a show-off, so the robot has to demonstrate its knowledge of every guest's birthday.
PartyRobot.happy_birthday("Frank", 58)
# => Happy birthday Frank! You are now 58 years old!Implement the assign_table function to give directions.
It should accept 5 parameters.
String)Int)String)String)Float64)The exact result format can be seen in the example below.
The seatmate's should be shorted to the first and last letter of the name. Frank becomes Fk, Christian becomes Cn, and so on.
The robot provides the table number. The robot also mentions the distance of the table. Fortunately only with a precision that's limited to 1 digit.
PartyRobot.assign_table("Christiane", "on the left", 27, 23.7834298, "Frank")
# =>
# Welcome to my party, Christiane!
# You have been assigned to table 27. Your table is on the left, exactly 23.8 meters from here.
# You will be sitting next to Fk.Once there was an eccentric programmer living in a strange house with barred windows. One day he accepted a job from an online job board to build a party robot. The robot is supposed to greet people and help them to their seats. The first edition was very technical and showed the programmer's lack of human interaction. Some of which also made it into the next edition.
Implement the welcome method to return a welcome message using the given name:
PartyRobot.welcome("Christiane")
# => Welcome to my party, Christiane!Implement the happy_birthday method to return a birthday message using the given name and age of the person.
Unfortunately the programmer is a bit of a show-off, so the robot has to demonstrate its knowledge of every guest's birthday.
PartyRobot.happy_birthday("Frank", 58)
# => Happy birthday Frank! You are now 58 years old!Implement the assign_table function to give directions.
It should accept 5 parameters.
String)Int)String)String)Float64)The exact result format can be seen in the example below.
The seatmate's should be shorted to the first and last letter of the name. Frank becomes Fk, Christian becomes Cn, and so on.
The robot provides the table number. The robot also mentions the distance of the table. Fortunately only with a precision that's limited to 1 digit.
PartyRobot.assign_table("Christiane", "on the left", 27, 23.7834298, "Frank")
# =>
# Welcome to my party, Christiane!
# You have been assigned to table 27. Your table is on the left, exactly 23.8 meters from here.
# You will be sitting next to Fk.