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 welcome back to another section where we are going to talk about a new topic called ERASE.
So what is in array in this video?
We are going to talk about erase and explain why it is an array, why you should consider using it and
so on.
So up until now, you've seen how single variables were created and used.
And by seeing single variables say simply mean that you've been using, for example, one variable of
some type rate.
For example, you could have created a variable with the name age and then assign it with some value.
For example, fifteen.
Or you could have created two other variables, let's say grade one and grade two to hold your grades
and then use them to calculate the average grade.
So we've created a couple of separated boxes or variables, as we also call them.
Right.
With different names to hold different types of data and different data.
And that was awesome.
But we want to go one step further.
We want to learn a new principle which is frequently being used in programming, and that is the array.
But before we do so, I want you to think of a time when you had to write a program to calculate your
average grade.
So we've simply created, let's say, two variables, grade one and grade two.
And we've used that to calculate the average of these two grades.
Okay.
But that was some basic scenario when we only had two grades and thus we had only two variables, grade
one and grade two, which were used to hold the data.
So in this case, the program knows only to calculate the average between these two grades.
And if we would like to upgrade upgrading somewhat our program, maybe just a little bit.
So it will be able to, let's say, calculate the average of three grades van.
In this case, we should simply add a third variable and maybe call it great.
Three.
Right.
And then we can just calculate rate, for example, after we added the third grade.
Then we can just calculate the average between these three variables of these three values.
Just by summing up all of them and dividing by three.
All right.
Now, what will happen if you have 10 or 20 grades that your program needs to store, not only to calculate
the average, but also to store for later processing of these data or something like that?
Will you create 20 different grade variables and call them by names?
I don't know.
Grade one, grade two, grade three and so on.
That's kind of absurd, isn't it?
Your program is going simply to be huge and your code is going to be very hard to maintain.
Not to mention the fact that you may have a lot of bugs because you have missed one or two grades in
your calculations.
So would you like to have a program with hundreds of different variables that just will present your
grades?
I bet you don't.
You would rather have some one collection with all the grades inside of it.
One collection that can be referred to with just one name.
That could be access to get the details regarding each of your grades.
It's just like putting all your grades in one bag.
And instead of spreading these grades randomly in the bag, let's say that we would like to use a special
type of bag.
Some unique bag in which all the grades are going to be arranged in just one straight line.
Now, when all the elements are well organized, we can access any of the grades we have just by using
or referring to this bag.
And let's also say that's the name of the bag will be grades, just like you can see right now on the
screen.
So we know that grades the bag we've defined may contain one, two, five or any other number of elements
or better say any number of grades.
And basically, we need we can access, read and write.
Are any element within these grades array.
So we can take any any grade in this bag.
And simply to see what value it holds.
So we can say that each element in the bag will simply hold a grade.
And how should you access any of these elements?
Well, we will see in the next video.
In one of the next videos here, how it can be accessed, because any of the elements here in the bag
has its own unique index, its own unique specifiers within this well organized bag, well organized
collection.
And just basic.
Jesse Frank, the index in the bag, we will be able to access a particular element and then you can
simply read into it.
Read for me.
Change it or do whatever you like.
So that's also one thing we're going to talk in the next videos.
And basically, to sum everything up.
We first create some unique bag than we can put inside of this unique bag.
Some elements, for example, grades and the elements we put inside this bag are not just scattered
around the area, arranging a street door there where there is a specified specified place, a specified
index for each of the elements in the bag in disarray.
And of course, this unique bag has some size.
Right.
It may has a different type of size each.
There are a lot of different bags out there, which is simply the number of aliments the bag can hold.
So the more elements are given, a given bag can hold, the bigger the bag itself would be.
Right.
You agree?
So we can create an array.
We can put inside the array some elements.
And there are some elements in a well organized manner spread around inside.
And also, we know that there may be different types of bags.
So that's just my analogy to how I see a raise and how I suggest you to look at them basically just
some bag to hold elements.
And you can access any of the elements just by using the index.
You can specify what is the type of the elements that are going to be inside of this collection, inside
of this array.
And also the size of the array may change.
So there are a lot of different bags out there.
And I promise you guys in the next couple of videos where we are going to talk about how it is used
in our programming language, things will become more clear to you and you will understand all these
concepts, all of this analogy.
So just for now, stay focused and let's move on to the last example that I want to talk about in this
video.
So let's see the array concept once again.
So there is an array here is on our array.
Yeah, we can see the bag on the right and in the middle.
Right now, we can see all the content, all the elements within this array, within this bag.
So this array has a specified size which says how many elements on this array may have.
And in this case, we have nine elements.
So the elements within the array are organized in such a way that this order of the elements matters.
And basically you can access any of the elements, just like we can see right now.
And you can change it just by using the index of the element.
So I really hope that this animated introduction of the arrays concept is clear for you.
And in the next video, we are going to take a look at how we can use arrays in our programming language.
So, as always, guys, thank you so much for watching.
And I'll see you in the next video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.