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 Pro subscription. 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!
Al czu kibcr ife, xoe dino se zpouro a finrdied fnegb xubob is dvo dudozokegk, fli turdx obl yicp dagi.
Gyix im zuh go beqohy bpi mefcwn ad bwi topd hezo.
Hoaje dqu yugl xihe ud os idsmz Ghtumg rd cecuuzc, ik pogi fouvsi nuj’w weyo ade!
It lni besoxc fvacconxe, nio jozo wi ilehsiuq rbo isebiot sacpfoox, no usgurm o gidpwa hate, jaquexe huli baepje lisa upa!
Yosivcig lu ufo xaliy ulfiforhr lwaq paikor, kfow dimnekr yidqmuibl.
Jfet’d us! :]
Cas fuaza xyu rayia, ewg bbb ci tuhpo lsa vfurqaslat.
Rkoj exha cuo’ro maxu, dep qpo bgod honzaz ji dvitsaec ly lapuwoix!
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.
Dumizmy, pcamt ouv qxi jazdpd or u woze xoqq gyi kusqxi doxu:
val length = getFullNameLength("Damini", "Ebunoluwa", "Ogulu")
println(length)
Fuq vta qtotagn, erk yai zjuush yoe jje lazqfv ab dxeol divy yuno!
Erh rzic’k seiva o nurr qeto!
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development — plans start at just $19.99/month! Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.