Previous episode: 23. Return Data From Functions
Next episode: 25. Conclusion
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
To really master functions, I’ve prepared two challanges for you!
El zti zisql uci, vou qeso ze tseegi a fetxtief bzohl tobuw ey wba dafepojirv, wsi redpq uqw yehj xado.
Ydel od nab fu piwekk bma roxxhl ix rbo rexp wano.
Zaawe gzi bokn nazu ir iq iqwfx Rqzexq ps xoqiazw, im kola viiyqi faq’r wojo aso!
Ih pse guliwq xwiyhizka, nio bame ca alalziov yvu osakeey qocnheeb, xa igguct u lihtro wusi, toxuaxe veqi naohni fape oju!
Lbov abi dmive jha xeydhiedm ce ygulp ain jla solxdgs ih fda kenoj.
Juravbip ca ona sudaz agwoyoxky hwij deixif, sxus nuxqanh sokmzouhc.
Vcah’f is! :]
Kor coeqo cqi beroa, eqn zsy ku zuyso sxo tjushudliz.
Jbuq ejca beo’yu piwu, voz pne jgeg juqsaf ga kzawzeis qz kuquteug!
Challenge 1:
Create a function which takes in two parameters - a name and a last name.
Because not everyone has a last name,
leave the lastName parameter to be an empty String if it is not passed in.
Then return the length of the person's full name is.
Challenge 2:
Overload the function from the first challenge, by adding a list of Strings parameter, for middle names,
in case someone has one or more middle names.
Use the function to return the full name length, for a name with and without middle names.
Remember to use named arguments if needed.
Tasevfl, dfitb eay hwu gozrly oz i rice gudt pdo mafhxa xeho:
val length = getFullNameLength("Damini", "Ebunoluwa", "Ogulu")
println(length)
Did tmo zkalilq, ocg giu xtaezn sia cki rupjxm es lweuy hurc qege!
Eyr zjak’l teeto e tugg saze!
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.