Helpe me with programing my function

Sorry, i'm a noob...
How i can do this?

Thanks for your help.