 Welcome to Intro to AP Computer Science for new AP teachers. The topic of this video is Primitive Types, which is our first unit that we really kind of introduced to the students. So let's go ahead and get started. So I'm going to do that, and then we've got Focus. Fantastic. So in this video, I'm going to talk about four major topics. One, I'm going to talk about my Intro to Java e-book. Part of this teacher training course and part of the course that I'm doing this for my graduate school is a, and there's a Java e-book that I've written that matches what I'm doing here. So you can kind of go down through that and kind of follow along, and it's pretty closely aligned with the way the AP has things organized. I've changed a few things to talk about that in a minute. Then we'll talk about the Primitive Types that you need to know for the AP Computer Science A exam. Talk a little bit about variable naming, because students need to understand this, how important this subject is, and I'll give you kind of an idea for an introductory exercise that you can do with the students. So let's take a look at the Intro to Java e-book. So what I've done is I've organized it into four sections. Data representation, organization, control structures and organization, object-oriented programming, and collections. So the section that we're on right now is Data Representation and Organization. So we're looking at Primitive Types and Math. Then we look at Strings and we look at Using Objects Part 1. So I've done it again slightly differently, and I'll talk about that as we go through these videos. This is kind of my own organizational idea based on the times we've taught the course and where the students really have issues. Just trying to scaffold those ideas, scaffold those concepts a little bit better than the AP does. So Primitive Types. So you need to understand that data has a type. In Java, once the data type is declared, it is permanent, you cannot change the data type. And so you have to be really careful and choose the correct one. The reason it has a type is related to how it is stored in the computer's memory. If that's something you're interested in talking about, there's a really good video, I think it's linked in my e-book from the BBC or something like that, maybe NPR, some kind of public television thing. There's a really good video that explains how and why data has a type. But the things the students need to understand that the type is related to the fact that different types have different sizes. So as a programmer, you want to be efficient, so we don't want to use too much memory, so we want to choose the right size type. And that each type has a different range of values. So the bigger it is, the bigger a range of values can be stored. Now, fortunately, the AP is very kind in this. Really, they only need to know the following three data types. Int, which is integer, these are positive and negative whole numbers. Doubles, which are decimal numbers, so like 1.21. Booleans are two values only. It's either true or it's false. So in the computer's memory, that's a zero or a one. So there are other types, but for the AP exam, these are the only ones you need to focus on. I almost never mention the other ones in my class. And then variable naming. Students are really bad at this, just because they're lazy to begin with. So they just want to call everything x, y, z, or whatever. They don't want to type. But I'm really, really strict about variable naming, especially as the code gets more and more complex. The naming becomes more and more important. So there's the practical side of it where you can't compile it unless, well, camel casing. So sorry, I'm getting off my binary. So camel casing is, so it starts with a lowercase letter and then internal words are capitalized. Now, if you don't do that, it's still going to compile. It just looks weird. So the next one is no spaces. If you put spaces, it will not compile. If you start with a number, it will not compile. But they need to understand that it is case-sensitive. So something like age, small a, small g, and small e, is different to capital A, capital G, and capital E. And finally, a rule of thumb for variables that they should be unambiguous. So you wouldn't use a variable called n. I mean, I know we do. But let's say it's number of students. So I would call it num of students, not just n. I guess you might end up having, you know, what C students do is n and then n2. And you don't know is n like num of students, is it 2, n2, num of teachers. You don't know what it is. If you don't know what it is, it's a horrible variable name. And now there are some exceptions to that. You know, we use i typically in loops, j and k, as you know. But these are things that really need to be emphasized. And personally, my opinion is I don't let students turn in anything with bad variable names. Meaning turn in. But yeah, it's not a good thing, OK? So then finally, again, if you haven't taught this before, so one good introductory exercise that I like to do with my students is we just look around the classroom and the students just choose an object and then start defining their attributes. So I'm looking around my room and I see I have a guitar over here. So I see my guitar has six strings. So what type is that? Is that an int? Is it a double? Is it a boolean? So clearly it's an int. And what would I call it? So I would call it num of strings. And that would be equals six. So at this point, you might want to write it on the board as a chart, like just a little chart. And then take a few examples and then go ahead and then on a different board or even in the code editor, if you have a video projector, start typing. So OK, well int num of strings equals six. And then you can go ahead and show them how to use print line again. So system.out print line, quote, number of strings, colon space, quote, plus num of strings. This way, they're starting to get the idea of defining variables. The variable has a type and then how to output that information. So it kind of combines a little bit of what we did previously or what they did previously with Hello World with what they've learned in this lesson. So again, that's how I would introduce it. You may have a better idea. Anyway, so thanks for watching. That's the end of that little lesson. And yeah, good luck. Thanks for watching.