Placeholder Image

Subtitles section Play video

  • Hey, guys.

  • Weapon I did journey Episode 7.5 I couldn't make it Episode eight But, you know, this is technically the second half of what I was gonna put into the initial one is just too long like a set before.

  • So let's go ahead and get into.

  • I think we're starting off on section 22.

  • It could be wrong, but in this video we go over a an exercise as well as the final quiz that ends off section too.

  • That I did not do too well on Enjoy.

  • Lecture 22 is a raise and not not like a raise, but a r r a y s raise a good example of this is salary.

  • So you don't want to Do you know you don't want to create a bunch of variables that you know employee salary?

  • Want our employees One salary, $45,000 employed to salary equals $23,000.

  • Var employees three salary devastate three I don't know equals $70,000.

  • You don't want to do that.

  • What you want to do is basically you do far Employeessalaries equals and then inside brackets you list you do 45,000 comma, 72,000 comma and so on.

  • And in orderto add to that array, what you do is use the A pen function.

  • You can remove something using remove function.

  • Uh, I'll show you some of gems on screen.

  • And if you don't have anything in the array, But you know you're gonna have something, you know you need that array.

  • So maybe, for example, say, for example, you have you wanna email list and you wanna put it all in array Unless you want to put your own evil on their first, you won't have any e mails to put in there, so you have an empty ray.

  • You need to declare that array with, Make sure there's parentheses after your brackets, another example of the screen, and then every time you had an email, you do the dot upend, or you set up a function where you do email list out a pen, and whenever someone enters their email into the dress box of hit submit, it depends their email into your ray.

  • And another thing to know about a raise is in between the brackets.

  • You know how I said what you want to do in between the brackets.

  • 45,000 common.

  • 23,000 comma Whenever you want toe.

  • Want to call one of those numbers for 23,000?

  • You and Cole Inside Array inside the array, you call one because the race start at zero.

  • Like just whenever you think of programming and counting at the same time.

  • Count from zero started zero because that's on the array counts and some other things.

  • It 012345678 So that the 8th 1 in the array will really be seven.

  • If you see I'm saying so and then after a raise in a lecture 23 we go over loose, which loose are very important.

  • We didn't go over all the lips and I actually learned a few new loops.

  • You know, the main loose that I would use four loop while loop.

  • But here we're kind of shown the repeat wild loop, which under really did that for something like this.

  • I'll do a four loop, but But what he did was after he showed us to repeat wild loop, he showed us a better way to do it and then another better way to do it.

  • So we went from about three lines of code or four lines of code two two lines of code toe, even smaller two lines of code or something like that in this four in loop.

  • Basically what what you want.

  • Would you want to realize about this loop?

  • And I understand there's a lot of context missing is going to be a little hard taking this out of context, but I can't just teach you the whole entire course.

  • It's kind of plagiarism, but I can talk about it, then give you my interpretation of certain things.

  • So the four salary in salaries live show on screen, basically for each salary and salaries it grabs each item out of the array one at a time, puts it in salary and runs a loop.

  • Now this was his example, I believe he forgot.

  • I believe he forgot to add in the salary plus salary times 0.10 So basically what we were trying to do with this loop is to add 10% raised toe all employees and just imagine if you were to not use an array, then you have to go to each and every single employee and then give them a raise one by one after you declared each employee one by one.

  • But I say we put all of them to array, and now we can do a loop into that array, which only take up to lie instead of who knows how many.

  • Imagine if you had 100 plus employees and you have to do 100 plus lines instead, you just do two lines.

  • So the mangle with this was to give everyone a 10% raise, and he forgot to put it in here.

  • Now let's go into a lecture.

  • Four dictionaries.

  • Now this one was definitely more difficult.

  • I wasn't really too familiar with it, but in all honesty, I know I said this before, but the way he explained it, you know, stuck in my head a little bit better.

  • I feel like a lot of other teachers.

  • When they tried to teach you something, the kind of forgot how it was to be a beginner trying to learn something.

  • But the way that he teaches it, he communicates to beginners a lot better than saying my college professor, no offense to my college professor, cause they're great But Mark is able to communicate on a different level, maybe more.

  • Maybe more so, like a don't down level less computer science, more code.

  • He starts off this lecture by saying Google, How do hash tables work?

  • And CS we'll use dictionaries a lot in with Jason Data AP eyes and whatnot.

  • So basically, where we call data say we're making a weather app.

  • They have Jason data that you call out.

  • So people you know made a P.

  • I call that into your app, and then you you coded.

  • So it displayed onto the screen just like your iPhone, whether rapper or android, whether at so never forget how to use dictionaries or should I say, learn how to use dictionaries?

  • I'm going to make sure I learned how to use dictionaries the right way.

  • And since I don't understand it like a cz Muchas, I feel like I want to or should.

  • I don't really know much to stay on it.

  • I see how you know if you have a dictionary, say of airports.

  • UH, O R F is Norfolk Airport.

  • You do imports O r f equals Norfolk, and then, if you want to override that you can say airports.

  • Oh, R f equals nil or equal something else.

  • And then you're able to override what you just did now into another exercise.

  • Lecture 25 is a loops in a race exercise.

  • For the record, I haven't done any of these exercises until, like the making of this video.

  • So I make these videos, you know, towards the end.

  • You know, obviously I've already done all the course and then I go back and do the exercises.

  • You know, you're supposed to do him along the way, But for the second video, do it after everything and especially, you know, maybe I may do it prior to the video and maybe do it along the way in the future.

  • In all honesty, I understand most of this stuff, or at least most of stuff prior toe.

  • Maybe this last exercise that we may be going over on polymorphism I think it is.

  • But we'll get to that.

  • So maybe in the future I'll be doing the exercises on time.

  • But as of right now, with the stuff that we're learning, uh, completely fund was just doing it when I make the video.

  • So this is section to lecture 25 exercise, swift three loose and a raise.

  • And I've already gone through this, but unfortunately, what I recorded my screen on decided to not work, and I went through the whole thing.

  • So what I want to do is leave this right here and just follow down with me as I go over exactly what I'm doing.

  • I actually decided not to leave my previous commentary in there because it was a little bit all over the place, considering the fact that I have the video to go with it.

  • So I wasn't exactly sure.

  • How is she?

  • Oh, about this.

  • So what I want to do is I'm just gonna post a these quick pictures right here so you'll see the screen shot of the arrays half and then you'll see the screen shot of the loops half right after.

  • It's like, right now you'll see the loops half after you've been seeing their raise half, and I will be going over it if anybody wants me to.

  • So I don't know how many people actually enjoy me going over the exercise.

  • So if you do seriously leave a comment below and I will make a whole other video of me going through this exercise again and what my thought process was.

  • I wish my recording software we should just QuickTime player on the Mac book didn't mess up.

  • But ah, you know, what can you do at this point?

  • So, yeah, let's go ahead and get back to the regular video lecture 26 optionals.

  • And he stresses, optionals are very, very important.

  • So basically says, if you don't want your program to crash, use optionals, they're very important.

  • So, for example, an optional say you do print and print this sees you lottery winnings.

  • Exclamation point exclamation point means when you get to this code, print out lottery winnings, you want it to print out 100% doesn't matter.

  • Print it out.

  • But if you don't have anything assigned to lottery winnings, your application will crash instead.

  • What you could dio is if lottery winnings does not equal nil print lottery winnings, let's still not all that great.

  • I mean, it's more than you need, of course, if it does equal nil, but don't just skip over that and you'll never see anything about lottery winnings on that line.

  • I'll just skip right over it so it doesn't crash, which is good.

  • But instead of doing that, you can do if let winnings, you could make it a bar or constant.

  • In this case, we're gonna make it a constant, which is let so if let winnings equals lottery winnings, print winnings.

  • So what that does is if there is a value in lottery winnings, it'll sign it toe winnings, and then we print out winnings.

  • If there's not a value inside lottery winnings didn't want to sign, then I won't even worry about printing anything out.

  • So that also works.

  • That is a preferred method over the last one that we just talked about.

  • Another thing you do, for example, if they do have our cars car and then a question mark after the bracket, what that does it says it may have a value or may not.

  • If it does pregnant.

  • If not, move on.

  • That's also what in it does, which is I N i t.

  • You can use that which stands for initialized, and I i n i t stands for initialized.

  • So you can do that if you don't want to do exclamation point.

  • A question mark.

  • I feel like from my understanding of it.

  • Now, that question mark would work best.

  • I feel like I'm never going to use the exclamation points, so I don't see why you would unless you don't want your program to work without it.

  • But if that was the case, then instead of putting exclamation point, I would not allow someone like, say, say, you know, your e mails required to sign up for this.

  • I wouldn't put exclamation point.

  • So if they don't enter the little crash, I'd probably put, you know, some type of if Alison or something like that, where it says if this has no value, re prompt and say, You know, you, you need to fill out the required areas And then once they find out their card areas, they keep on going.

  • I don't know why I would use the exclamation point.

  • Really?

  • Maybe I'll find out in the future.

  • Maybe I'll just never use it.

  • We'll see.

  • In the main point of this is optional Zehr used toe.

  • Let your program move on and not crash.

  • If there's no value in certain things, just like talking about so you're going down your codes reading boom.

  • It hits one of those exclamation points where the value where there's no value it crashes.

  • Instead, they'll just say, Oh, there's nothing there.

  • Skip over it.

  • People roll.

  • So that's what that's for.

  • So very important.

  • Remember Optionals lecture 27.

  • We get the object or into programming, which basically object oriented programming came in, I believe in, like, the seventies or eighties after was functional programming, which is still around.

  • We'd be wrong.

  • But object oriented is probably what you're going to be doing if you are interested in.

  • I was development one.

  • So I developed you're gonna be doing object oriented programming.

  • Functional programming is more so.

  • I don't know how to explain it.

  • Maybe, maybe, like writing software for printers are like that.

  • It's a good question, but a big thing about object oriented programming.

  • Our classes and Mark explain these really well.

  • I never you know, I use classes before, but I didn't understand it like I like, I understand it now.

  • So what?

  • His example was vehicle class.

  • So class vehicle, and inside that we had you know what a vehicle has.

  • So we declare tires that equals four headlights and then we had functions.

  • Which one was Dr?

  • Because these functions are what the vehicle does.

  • So we had function Dr.

  • Function break.

  • And you don't even need to put anything inside the curly brackets.

  • You'll just reference the later, which is the thing about classes where you reference them as opposed to something like what we talked about before, where you would pass by value, which is copying.

  • You know, what you had done over instead of referencing it.

  • And you may not completely understand this.

  • I still you know, I still have Thio have to re read and re study, and I don't completely understand all of it, but it will definitely come over time back like a year ago.

  • I never thought I would be this far.

  • But now imagine next year I'm gonna be thinking last year I'm like, What we have to do is just, you know, stick with it.

  • And as we stick with it, more come in, come in.

  • Come is we use it.

  • It would just be better and better.

  • So that is my advice to you is just so quit.

  • That's the main thing.

  • If you do it, you know, for even a couple hours a week for a year.

  • You'll be pretty good if you're doing it for three days every single day for three months.

  • You're gonna be pretty good at whatever it is you're doing as long as it's not, you know, trying to become the next LeBron James with basketball and you're doing something that you know that you can learn.

  • Let your 28 is inheritance, which is still kind of falling to me.

  • Although I've gone over this and suppose plus, it's it's still is funny, but I mean, basically, it's you create a parent class and Children classes within those air under those and the Children classes inherit things from the parents.

  • Not like you're inheriting money, but like you're inheriting genes.

  • So that's the main understanding I have of it.

  • So I'm not.

  • I'm not knowledgeable.

  • Thio.

  • Try toe, teach you guys about it.

  • So let's move on to Lecture 29 which is probably more physical Marks, said that a popular interview question is defined polymorphism, and he's and his own words were I can't really define polymorphism, but I'll show you an example.

  • What he says is that you know, to show an example is a lot easier for him.

  • A falling more fizz, Um then actually liked finding it.

  • So he gave us an example.

  • You give us an example in code, but what kind of what I understand from it is I'm gonna nerd out a little bit.

  • So you say, playing a wardrobe crafter or any other game that has, like, classes and section of stuff.

  • So workouts is what comes of mind that has hoarding alliance.

  • So let's a horde.

  • So that's H o R D e horde horde.

  • So under that faction, you have races like Tauron work, undead blood elf, and then under each of those you have your your classes, which is May JJ whatever in a specific for each.

  • And that's kind of the basis of polymorphism from I understand.

  • So that's saying is probably more fizz, Um, where one object can take on many different forms, which is basically what that example was trying to explain.

  • Horrid can take on any of the other forms.

  • Lecture 30 was a different guy.

  • I forget his name.

  • It wasn't It wasn't Mark.

  • He was very easy to understand.

  • Like I had some concerns where some guest speakers may have thick accent or something like that that I can't really understand or I will follow it just kind of zone out, get bored.

  • I'd skip through this because I'm not gonna remember anything that he's gone over.

  • I'm not gonna remember anything until I need it and use it.

  • So it was kind of a useless thing.

  • I may refer back to it that, you know, I do.

  • But so let's finish this off by doing this final part of Section two, which is quiz once.

  • It's five questions.

  • Let's do it.

  • So here is that swift three Quiz Finishing off Section two.

  • Let's go ahead and start it.

  • Yeah, I got zero out of five correct on the first.

  • A tent?

  • I don't know.

  • I don't know.

  • I thought I was right on quite a few of them, but I wasn't so that's it for the quiz.

  • And that's it for this video.

  • You guys enjoyed it.

Hey, guys.

Subtitles and vocabulary

Click the word to look it up Click the word to find further inforamtion about it