‫Welcome back.
‫And this video I would like to teach you about variables, because variables are a very important aspect
‫in any programming language.
‫A variable is a container that can take a value.
‫And maybe after some time we decide to store another value in the same variable, meaning in the same
‫container.
‫So let's look at this trivial example here.
‫Imagine you are in an open buffet and you want to take a cup of coffee along with an amazing cake.
‫You would need a cup for the coffee and a plate for the cake because a cup of coffee is made to take
‫liquids, not, for example, cake.
‫Putting the cake in a cup of coffee would not work because it won't fit and probably because people
‫will stare at you.
‫So this is exactly how variables work.
‫If we compare variables to our coffee example, a variable must have a type which is the type of plate
‫or cup.
‫For example, the type of the variable will tell us what kind of data it can store, where the data
‫is our food or drink.
‫And because we usually deal with many variables in our programs, we will need to distinguish between
‫our variables by giving each variable a name.
‫So you have to type the name and the data that is inside of it.
‫NC Sharp This is how we define a variable.
‫Let's say we want to store an integer number, whereas an integer number is a whole number like one,
‫two, three and so forth.
‫Then int is our variable type.
‫So I am a number is the name of our integer variable.
‫And finally, five is the value.
‫So we have to type the name and the value that we assign here.
‫This way we created the variable of type int and we named it I am a number and we stored the value five
‫inside of it.
‫There are other data types in C-sharp besides the most important ones that we need to know about for
‫now are float, which we use to store float numbers, meaning numbers that have decimal points like
‫pi.
‫We can use them to store values like speed, for example.
‫Then there is pool which we use to store boolean values which can be either true or false.
‫We use them to store values like steps enabled, and we can then use these booleans to decide what to
‫do in our app.
‫For example, if the GPS is not enabled, so is G.P.S. enabled equals false?
‫Would be the statement here.
‫Then maybe we want to show a message to the user to enable the GPS to use the app.
‫Then we have string which we use to store text.
‫We need to use the quotations to specify that these are actually text and not code.
‫We can use them to use the username, for example.
‫Then we have char, which we use to store a single character, like an ad sign or a dollar sign.
‫We can use them to store special characters because if all we need is one character, then a string
‫is going to be an overcoat.
‫So it's taking more memory than the character.
‫So the more variables we declare, the larger memory our app is going to require.
‫Think about it as if you are using a very huge coffee cup to store a small amount of espresso.
‫So that was a little bit of an introduction into the ideas of variables and data types in C-sharp.
‫We're going to use them in practical examples and then it will make a lot more sense.
‫All right.
‫So that was a super high level view onto variables and data types, and we only saw a couple of them,
‫right?
‫Three different types.
‫Now, let's look at data types in more depth and a couple of examples in the presentation.
‫And then after that, we're going to look at particular examples where we are using different data types
‫and see how they interact with each other, because that's also something we need to take into consideration.
‫But first, let's look at more data types as well as learn how they are limited because you can only
‫use certain values inside of data types.
‫Even though an integer can hold a number, it's not capable of holding a number like a trillion, for
‫example, and that's where loans come in.
‫So let's look into that in the next video.