Question: // EXERCISE 1: complete the following function. // It has two parameters: // - i18n : (a reference to) an instance of a class that
// EXERCISE 1: complete the following function. // It has two parameters: // - i18n : (a reference to) an instance of a class that extends / implements the Internationalization trait (interface) defined above. // - name : a String // You should use the "greet" method of "i18n" to find a greeting for "name". Return the result. def useGreet (i18n : Internationalization, name : String) : String = { // TODO: Provide definition here. null }
// EXERCISE 2: complete the following function. // It should return an instance of a class that extends / implements the Internationalization trait (interface) defined above. // The "greet" method should return a String consisting of "Hello", a space, and the name given as an argument. // You can either define classes inside the newEnglish method or directly inside the "dynamic" object. def newEnglish () : Internationalization = { // TODO: Provide definition here. null }
// EXERCISE 3: complete the following function. // It should return an instance of a class that extends / implements the Internationalization trait (interface) defined above. // The "greet" method should return a String consisting of "Bonjour", a space, and the name given as an argument. // You can either define classes inside the newFrench method or directly inside the "dynamic" object. def newFrench () : Internationalization = { // TODO: Provide definition here. null }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
