Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
What is going on, guys?
And in this video, I actually actually I think this video should be split up into two parts, OK?
The first part should be in this video.
In the second part should be in the next video.
So basically, what should these exercises be all about?
So we are going to write a simple function that is called to lower, OK, so functioning is going to
be to lower and these function.
All it has to do is just, first of all, to receive a character.
So you know how these can be done.
Right.
And what function can receive a character in.
Once you do receive a character, you have to check if this character you just received.
OK, this character is a capital letter in English, OK, capital letter in uppercase, let's say if
it's in uppercase uppercase letter, which means all of the letters from A, B and so on out to Capital
Z.
Right.
If that's the case, then the function, what it has to do is to return the lowercase, the lowercase
representation of this letter, the lowercase letter.
OK, so in this case it should return.
Either it's a if it was in upper case, A either is B, either it's C and so on.
OK.
So basically you got the idea right.
That awesome.
OK, so that's what do you have to do.
And if the character is not an upper case, meaning that the result of this condition is false, then
the function should simply return, let's say otherwise return.
Minus one.
OK, so that's basically our function for now, I hope that's clear, simply a function called to lower
receives a character checks.
If this character is an uppercase letter, if that's the case, we return the lowercase representation
of this letter.
Otherwise, if the character was not in uppercase, then we will simply return minus one.
So that's our function for today.
OK, so let's start.
And first of all, what we have to think about is what will be the type of this function?
So we know that we have to return the character.
So probably chances are high that we need to return it of type char.
So Char and let's call this function to lower as we were requested, that unspecified char and let's
call this letter.
OK, and now the body of the function should be something like that.
We have to somehow to be able to distinguish if a letter is a capital letter, is an uppercase letter
or.
So we know that if we have taken a look at the ASCII table, then all of the letters which are from
A to Z, OK, from capital A. to to Capital Z, from uppercase to uppercase, that they are all kind
of in a sequence or there all comes after one another.
So if we will ask if a letter is greater or equal to a two to upper Casey and also if this letter is
less than or equal to Capital Z.
OK.
So if that's the case, meaning it can be all the letter from A B up to Z.
OK, this is the range.
It can be.
Then in this case, we should return this letter.
OK, in the lowercase representation.
So meaningless right down here.
One example.
So let's go like examples.
And basically if you received a letter like that K then what you should return is just K if you receive
the letter like B then you should return B and if you receive it, I don't know some letter like this
for then you should return simply minus one.
OK, so how basically if you know the representation of the letter itself, if it's an uppercase, how
can you calculate and return the lowercase representation.
And that's something that we have basically to understand about the ASCII table, which we have to do
is just to take the letter.
OK, so what we will do is like to return, OK, return and what should we return?
We should return the letter itself.
It has some numerical representation, right.
Although it's a character and we will reduce the value of an uppercase A..
OK, so this has some numerical representation and also a letter has and basically if you take a letter
and you do minus the the lower the upper case A, you will receive some number either, which will be
one, two or three or four or five, six, I don't know, up until 26, if I'm not mistaken.
And once you do so, you will receive here just some, let's say, integer number and you want to return
the lowercase representation.
So in this case, you will take plus and you will add a lower case, a lowercase eight.
So why is this so useful?
You know, that if you had a letter, let's say I don't know.
See.
OK, so if the letter was capital C and you took the letter and you reduced A from it, so you received
basically two probably.
Right.
You'd say, yeah, it's it will be too, like the the numerical representation of C minus the American
representation of A which is behind the scenes simply simply C equals two if I'm not mistaken.
Forty three and a capital eight is forty one.
Right.
Forty one capital A's were presented as forty one.
Then you will have here two OK.
And then you will take two and you added to the lower.
Case eight, which in this case, I'm sorry, sir, it's not 43, it's 65 and capital and it's 67 and
capital, a little upper case, a sixty five.
Then in this case, also, it still will be two.
OK, so let's have a minus.
Uppercase is two plus A and A is ninety seven.
Then you will receive 99, which is the decimal representation of a lower case.
C OK guys, so you see what we are doing here.
Is that clear to you.
So that's basically how you take these kind of formula, how you take OK and you simply calculate from,
from the uppercase character representation to the lower case representation.
OK.
And of course the Eltis return to minus one.
So I know that's not the most trivial exercise, but that's the basis and the basic representation and
usage of the ASCII table.
So please, guys, let me know if you still have any questions.
Feel free to ask it.
Maybe I will try to clarify it even further.
And yeah, don't worry, it's not so complicated in the next video.
We are going also to practice this even further.
So thank you so much for watching and I'll see you then.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.