In this lecture, we'll talk about the commonly used integer data types in C#. So, integers or whole numbers, are those numbers that have no fractional or decimal part like these examples here. And there are four commonly used data type we use in C# for whole numbers, byte, short, int and long. And in this course, and in most of our game development, we'll end up always using int, but there are times when those other data types are useful as well. So it's important that you understand that they're available. Even though we will mostly use int. So the difference between those data types is the number of bits we use to represent those data types in memory. So byte uses 8 bits, and short uses 16. Int uses 32, and long uses 64. So those different data types take up different amounts of space and memory. What does that tell us? Well, we know that two(b) equal n. So if b is smaller, then n is smaller which means that byte can represent a smaller range of whole numbers than short. Smaller than ints, smaller than longs. And so that's one of the reasons why two(b) equal n is an important thing for us. For all of these data types the arithmetic or mathematical operations are pretty much as we'd expect where addition, subtraction and multiplication work in the way we think they will and division works slightly differently. So, if you think back to your grammar school or grade school days, when you used to do division you came up with a quotient and a remainder. And that the division operator for integers gives us the quotient. And we'll explore that idea a little more when we start writing some code, so, let's go do that now. So, in the start screen for MonoDevelop, say you want a new solution here near the center toward the left. It's a consul project, so we say next, I'm going to call this IntegerDataTypes, and hit Enter or say, create and I'll zoom in. I'm going to start by adding a class comment here. So three slashes and it automatically adds the XML and I will say, this is the Integer Data Types Lecture code And I will also comment the main method, three slashes, and I will say, Demonstrates integer fata types Not fata types, data types. And I'll just do a little clean up on this comment that it automatically provided. And so, let's add some comments for what we're going to do here. First, I'm going to declare a variable, but I don't need to really comment that. I will say here's what we're going to do, here's the problem we're going to solve. We're going to have a total number of seconds that we played the game. And we're going to calculate how many minutes there are, and how many leftover seconds there are in that total number of seconds. So we'll say calculate minutes and seconds played, and we'll say print results. And finally, I will add that blank line that I know and love. So if I Ctrl+F5 at this point obviously it builds and doesn't really do anything except print that blank line. So let's start by declaring a variable to hold those total number of seconds played. And the way we declare a variable is we start with the data type, and because I'm storing a whole number here, I'm going to start with int. And I'll hit space and now I have a variable name going to provide a descriptive valuable name here totalSecondsPlayed. And if I put a semicolon here this a valid valuable declaration however I'm going to give this totalSecondPlayed an initial value as well. So I am assigning the value 100 into this totalSecondsPlayed variable. Next, I want to calculate minutes and seconds played. So the minutes played will also be an integer. So I will declare another variable int minutesPlayed. And you'll notice that I'm starting my variable names with a lowercase letter. And every additional word after the first word, in those variable names, starts with a capital letter. This is not required by C#, it's just good C# programming practice. So how do I calculate minutes played? Well, it's total seconds played. And you'll notice, by the way, that this pop-up over here starts auto-completing for me, and once I get to what I actually want it to be, I can just hit Tab and it will fill in the rest for me. You've probably seen that functionality before in software. So it's total seconds played divided by 60. And, as I mentioned, this division will give us just the quotient which is what we want. So now let's print the result using Console.WriteLine and it's important to always label numbers that you're printing out to the user. So I'm going to say 'Minutes Played' instead of just printing out the end result there. And then I will say print the value of that variable that I calculated. So the way this works is this is what's called a string literal so this will get printed exactly as shown because I put it between double quotes. Because this is a string, minutesPlayed will get converted to a string rather than an integer. And this plus here is not an arithmetic addition. It is called concatenation with strings. So we'll print this piece out without the double quotes. And then it will print out the string for the integer value of minutesPlayed. So if I Ctrl+F5 at this point, you'll see Minutes Played is one, and you can look at 100 seconds and say, how many minutes were played? And, yes, of course it's one. Now what we want is the leftover seconds played after we take out those minutes. So I'm going to declare another variable. This one I'll call secondsPlayed, And it's going to be totalsecondsPlayed something 60. Now, let's take care of the 60 first, because I'm about to use 60 for the second time, and 60 has meaning to me in this program. It's not just the number 60, it actually has specific meaning, it's the number of seconds per minute. And so instead of having this number appear multiple times in my code and, by the way, it's called a magic number. Because it's not just sort of a regular number, it actually has meaning. So let's declare a constant. The number of seconds per minute that doesn't change as we run our program. So this will be a constant, so we start with const and it's an integer as well and we will call it SecondsPerMinute and will give the value 60. And you'll notice that I started this with a capital letter. So, again C# programming protocol is that constants start with the capital letter and variables start with the lowercase letter. Okay, so I can get rid of this 60 and say SecondsPerMinute. In here I need the left over part. I need the remainder, and it turns out that the percent sign in C# will give us the remainder for integer wrap. So I can get the seconds played by taking the totalSecondsPlayed in getting the remainder of dividing that by SecondsPerMinute. And we will WriteLine that as well. Of course with a label again. And I'll Ctrl+F5 and you'll see that we've got Minutes Played is one, Seconds Played is 40. And with a total number of 100 seconds, that's exactly correct. Last thing before we leave the code. I will say that if you go online, and you say how do I declare a variable in C#? You'll find lot's of people saying just put Var. And, that is valid, in a number of programming environments. But, don't do it here, in this course. Really, what it is, in this course it means, no offense! Well, a little offense is, you're too lazy to figure out the appropriate data type so you'll just type Var. And I want you to understand the data types and pick the appropriate ones. So don't use Var to declare variables. Okay, I have Ctrl+S to save this so we are done with our programming for this lecture in MonoDevelop. Now that we're done with the coding for today's lecture, let's do a couple of in video quizzes. So go ahead and do the first one. Well this is great, right? You can brag to people on taking a college level course on Coursera, and I had a quiz where the question was what is one plus one? And I got it right. I mean, I hope you got it right, it's two. And so that is very exciting but this next in video quiz, is a little more interesting. So here, they integer is probably counter-intuitive to you. So the number we started with, is the maximum possible integer in C#. So when we add one to it, we actually end up with the minimum possible negative number in C#. And that is actually a direct effect of two(b) equal n. And I've provided an additional reading for the lecture that talks in detail about why the math works this way, but just know that this whole idea of two(b) equal n, is not just of academic interest that professors like to talk about. In fact, this was a problem in Grand Theft Auto Five. In the initial release, where one of the players got very, very rich and then they got a little more money. And they were a very, very bankrupt. And it was exactly this problem. That ints wrap around once they reached they're matched value. Before we end this lecture, I want to make the distinction between value types and reference types. So we talked about data types and that the bit get interpreted in a particular way based on the data type we've declared a variable at that memory location to be. For value types, like bytes, short, int and long. The bits at that memory location are in fact interpreted as an integer, a whole number. For reference types, which we'll talk about in the next module, those bits are interpreted as something different. They're interpreted as a memory address. So, we don't have to worry about that for now, but I wanted to, since this is the first opportunity I've had, I wanted to mention the difference between value type and reference types and certainly the numeric types in C#, our value types. So today, we've learned about the different data types we can use for whole numbers and we've actually done some coding with the int data type in particular