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
So let's start writing our program, our monthly program right away, guys.
So let's start with something that we already know how it should be done.
First of all, we know that we have to receive some month value, right.
We are going to let the user insert these value so into the month, the month number.
And that's what the user is going to insert.
So enter the month number.
So in this case, we will read the information from the user and story inside of variable month, and
that's it.
Now, what we have to do is simply to think about what should be the solution.
So what we should do is simply map OK from a given number to some value, write to some representation
of the month, the name of the month.
So if we know that if we received one, then in this case we should bring in January and so on.
Right.
So we simply need something to map.
Of course, we could do it with some basic FLC if and FLC and so on, so, so forth.
But this approach we talked about it in the switch cases section probably is not the best idea.
So what is a better idea is simply to use switch case.
So to switch and we are going to specify the variable that we are going to run in to check all of its
conditions.
So switch month and now we will specify different cases that these variable month can have.
So the first case is case one and by saying case one, this simply means it's kind of analogy to if
month equals to one.
And that's now let's move to the second one.
So case two, OK, so case two, that's the second case.
In this case, we should simply print February, February, write that some application that we were
creating.
OK, and that's OK.
It's not a complex application, but it's a kind of longer than the usual programs that we've written.
But it's kind of nice, right, because we actually get some feeling about the real application.
OK, so suppose that you have to write this really program that gets some number and it's capable of
printing the actual name of the month.
And in this case, let's add also case three and printer for what I think.
OK, so also break.
And there you go again and again and again for all the cases.
So let's simply just copy it and and it's like that.
Like that.
And finally like this.
OK, so.
OK, so now that's simply modified.
OK, it's also OK, the best approach is not to use here or copy paste, but since I know your time
is precious, I decided to take this risk.
So case four is a real and R case five is a case six is June.
Case seven is July.
Case eight.
Where is it.
Case eight is what is it.
August.
Our case, nine years of timber supply timber case 10 is October, case 11 is, what is it, November,
and case 12 is December, the same in her case.
So, yeah, basically, that's it.
Right.
These are all the cases that I wanted to cover.
So it's January, February, March, the date.
OK, so everything seems to be working correctly.
We received some number from the user and we print the corresponding month.
Made our case so awesome.
And last question that remains here is basically what should you do if you receive some number, which
is not in this range, which is not one up to 12, for example, 13 or minus two.
So you also have to treat this case in some way and that's how you do it, in which case of the default.
If it's not, neither are any value from one up to 12, then in this case, simply some error message
here or try again.
I don't know, try again sometime between one to 12.
OK, so that's my recommendation on how you should solve this exercise and basically how you should
apply the default value, the default case.
So the default will be executed only if neither of these cases was executed.
So if one of them was true, that means that the value we received from the user was between one up
to 12.
And in this case we would executed and print the corresponding month name.
But if that's not the case.
OK, so let's say to the user that we got some error and asked him to try again some month between one
to 12, because he probably he or she probably did not use a good some good or a more appropriate number.
So, yeah, this is it for this video.
Let's just build and run in to make sure that everything is working as expected.
So enter the month number on.
Let's go like five.
So it's May and let's go with seven, which is July and let's go with one which is January.
Awesome.
Let's go with some non-trivial number fifteen.
So oh ever try again.
Some months between one to twelve.
And that's awesome.
We also handle this kind of problem.
So yeah guys this is it.
Thank you for your time.
You are now an expert of creating different programs for calendars.
Yeah.
And this is it for this video.
If you still have any questions, feel free to ask them.
My name is Bloodwood Netsky.
This is Alphatech and of course, keep on practicing.
Keep on moving forward with the course and I think you are going to do well.
So until next time.
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.