Skip to content

10. 实现一个GreetRobot,使之具有以下能力 #10

Open
@senfish

Description

@senfish
// 实现一个GreetRobot,使之具有以下能力
// 1. 执行GreetRobot('bb8')
//    输出: Hi this is bb8!
   
// 2. 执行GreetRobot('bb8').greet('Bob')
//    输出: Hi this is bb8! 
//         Nice to meet you Bob.
        
// 3. 执行GreetRobot('bb8').greet('Bob').greet('Jerry')
//    输出: Hi this is bb8! 
//         Nice to meet you Bob.
//         Nice to meet you Jerry.
        
// 4. 执行GreetRobot('bb8').greet('Bob').greetVip('Mike')
//    输出: Glad to see you Mike~
//         Hi this is bb8!  
//         Nice to meet you Bob.
        
// 5. 执行GreetRobot('bb8').greetVip('Marry').greetVip('Mike')
//    输出: Glad to see you Mike~
//         Glad to see you Marry~
//         Hi this is bb8!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions