Placeholder Image

字幕列表 影片播放

  • What's up, guys?

  • The initial plan with this video, it's just make one big video, but it just ended up getting way too big.

  • So I split up into two and you'll see me throughout these next two videos, talking as if it was one large video.

  • So just don't get confused and enjoy the video.

  • What's up, guys in a forest Not welcome.

  • Tow Journey Episode seven We are going to finish up section to I know I said something about section two before and said that I just kind of would skin through it a little bit, but I went more in depth in section two.

  • There are believe, three exercises that we're gonna go over in this video.

  • At least you're going to see my solutions.

  • I don't wantto make a super long video.

  • Last video is like 23 minutes.

  • I don't want to keep mine between 10 and 15 minutes, so I don't know.

  • We'll see.

  • Uh, we're gonna do at least one completely, you know, maybe like last time, You know, fast forward through a couple like simple parts of repeats, and then I'll show my solutions to the other two exercises and then also the beginning.

  • Section three is get Hub will be doing that next week, and I've already started that.

  • But it starts off with an exercise.

  • So I just figured I'd end it with with Section two and they pick up next week.

  • I want I want to make Section 31 hold video for next week, so I have a lot.

  • I have a lot of work to do, so let's get to it and lecture 18.

  • I discussed this two videos ago a little bit.

  • Its functions functions aren't really that difficult.

  • Where we're at right now, you know you're gonna be able to use more complex functions using with with other problems down the line.

  • But right now, with the problems ever doing, it's not really all too difficult.

  • And although although I've already like known it no little bit about functions from C plus plus, Mark puts into really good terms, and it's very, very helpful the way he teaches, and it definitely help help functions of what they're all about.

  • Sticking my brain better the way he explained it, which I just saying a lot.

  • Lecture 19.

  • We went over bulls and conditional logic and the main things Thio take note are the condition ALS or whatever the cause.

  • So right here you see equal equal.

  • So this equals is when you compare to things These are on the operators.

  • I guess I'll call them.

  • Let's go to the computer and I'll show you.

  • I'll give you guys example of each one.

  • So here are some examples of the bullying operators.

  • So before we get into that, uh, just take a look up here.

  • This is your guide so equal to its two equal signs not equal to exclamation point.

  • You could sign greater than in less than an all.

  • These are kind of self explanatory.

  • So we do first, is we?

  • We made a variable named bank balance bank balance.

  • He goes $400 I don't divide those $500.

  • So what we dio is if bank balance is greater than or equal to item to buy that we could purchase the items in this case, we can't.

  • So imagine if this if this was 500 this is 400 then we would be able to do that.

  • But we can't because we don't have enough money.

  • So this is just giving you a real world example for greater than if I don't go by is greater than bank balance.

  • Then what you pronoun is say you don't have enough money or go get a job or something like that because you don't have enough money to buy what you're trying to buy.

  • So you're going to get rejected unless you know, you, you go negative and you're being come.

  • But who wants that?

  • So that's an example of greater than or equal to and the greater than equal to.

  • If I don't buy equals bank balance, we'd probably want to let those people know that they have $0.

  • So Fig's exactly 500 like this up here, 505 100.

  • Then it would turn out this way, and we would want to let them know that they're being balance is now zero.

  • And then I couldn't find a good, uh, not equal to on that one.

  • I wanted to give you guys a better example.

  • So say you're in, uh, in a library or something like that, and you're trying to check out a book and you search on their, uh, I forget what it's called, but that library software that you're able to track all the books in search and see that it's in stock and whatnot.

  • So here we have to book titles.

  • The real book title is Thinking Grow Rich.

  • The title that you typed in is thinking Go reach.

  • Maybe you misheard it even spell that you're thinking of something else, but you spelled it wrong.

  • So if a book title one does not equal book title to We Have Toe, let the person know that book's not found.

  • Check your spelling so there's different ways to say, Like if you're if you're close, you know if you're this close and I would recommend this, but we're just doing the basics where if it's not equal than the book is not found, we can't find the book that you're searching for.

  • Check your spelling and those of the examples of those, and you'll understand you understand if it's less than or equal to just to say, we switch to these two around or we could even just go like this.

  • But like I said, yeah, we would have to switch these two around, so forget about that.

  • So that's how those Boolean operators work.

  • And right now we're going to get into exercise the 1st 1 for this video functions.

  • So the first thing to do create a new, extra playground done creative function named Ad that takes two parameters of type double and returns to some of the two numbers.

  • So we want to create a function named Ad.

  • All right, Dad, we could name these, uh, number one, and then it said it wants to be a double.

  • We do it like that.

  • And then we do know, too.

  • You could name whatever you want, but that's just what I'm gonna name this for sake of argument and then within it.

  • What did it want us to do?

  • You want us to return some of the two numbers so we could do return number one plus number two on you?

  • Don't call it anything.

  • So let's be right, Right?

  • No, Maybe not.

  • Maybe not.

  • I would have to send this over like this.

  • Make that a double like that for that.

  • You were great.

  • I don't see that returning anything.

  • Let's Let's go into the next deal.

  • Sometimes there's a slow for me, so I just have to keep moving and then I'll come back to you in a bit.

  • So that was questioned to question one question to now three creative function name subtract that takes two parameters of type into so integers and returns difference of the two numbers.

  • So basically, just don't say anything, but subtracting way just return.

  • It seems that weighs last time, but subtracting.

  • But what do you want us to do?

  • Returns a difference of the two numbers.

  • So Oh, that's right.

  • What we didn't do is a sign numbers to the actual, very correct.

  • See, I'm still having trouble with this reader over here because it's just this hell, a playground.

  • But it's not Hello, playground.

  • So what we're gonna do is we're gonna eggs out of this and then and then I'm gonna pay you back in.

  • Hopefully that'll fix it.

  • The notion had I don't think you have anything because we haven't cleared number one to be any type of number of suffer a double.

  • So basically, the next thing we do is it seems like thing, but we multiply floats, and then after that, we're gonna divide double.

  • So it's just hurry up and do that already.

  • So because it's really not that difficult we're gonna do next.

  • Is all this functions all this?

  • What does it say?

  • All of this functions in past different values into the parameters.

  • And sure, they're producing the correct results.

  • This isn't miss.

  • I don't know.

  • This may be a misprint, but eventually we're giving all these numbers.

  • Okay, so it looks like it wants is to assign these.

  • It was just a reference our call these functions into a situation where we're actually declaring the numbers so we can use of our or let do what?

  • Make it nice and neat.

  • Let, uh I don't think I can use ad let plus on the's air doubles.

  • So, actually, just not do that.

  • Let's do 3.3 e.

  • I think I have to put equal sign there.

  • Maybe.

  • Yeah.

  • Okay.

  • And now it goes back up into Oh, this is the last thing that you wanted them to equaled within this function way.

  • Just do that with all let minus.

  • Make number two equal seven.

  • We'll see that this doesn't work because it needs to be an interview.

  • Integer to an integer.

  • So if we take these out, it works.

  • Eight minus seven a minus three.

  • Even if we put a double over here, it won't work because obviously there, declared to be an integer hasn't changed yet till I get out of there.

  • As you can see, there's errors era here.

  • It just didn't change her here.

  • Three folk can only hold like so many bites.

  • It's only it's only so many bites worth, while a double is a lot bigger than afloat.

  • So normally they say, use use a double.

  • Some people would like to say, Oh, no, I want to use a float because it's going to use the last memory Well, it's not worth in the long run.

  • I mean, if you need a change of that means you'd have to go back and change the float.

  • And the only reason you need to do that is if there's an error in your code.

  • So So I think that's it.

  • They just want us to throw values in there, make sure it worked each and every way.

  • Major, the double worked right?

  • Our major first of all, major, that our function works right, major, that we declared it correctly in order for you to doubles to come on as a double.

  • And in order for us to only be allowed to put in doubles, there's well into your float and double again.

  • Now, lecture 21 is constant and logical operators where before we had, like, bullying operators where they had the two equal signs greater than greater than equal to lesson lesson or equal to.

  • But now we have the logic operators Which air and or not so and is the double Amberson or is double pipes and not is exclamation point before the word or the This is how you may know how to do it.

  • You may know how to do it like this.

  • If yada yada is not equal to this, then you know you do whatever's in the parentheses or, you know, you could do else.

  • Yeah, you gotta.

  • The better way to do that is like this.

  • So you just put the exclamation point before this word and you don't have to worry about that, and it means exactly same thing.

  • But it's a lot simpler, you know, you save you know what, six characters of code, but it works out better that way later down the line, just it's better practice.

  • Supposedly I know I kind of chicken scratch, but, you know, I'm sitting there listening.

  • I'm just writing it down real quick, and it's, uh it's what works for me, you know, I don't need to Exactly.

  • I know what I write.

  • So I can kind of go back here and just reference it.

  • I'm not going to sit here.

  • And if allowed entry does not.

  • And that's the thing about learning how to find what works for you.

  • You have to find that's about being taught with anything.

  • You know, we're not just being taught with anything, but whatever you may do, you know, if you're putting together a desk, I may do it differently than you.

  • But if it gets done either way, you know, 1 may be more efficient.

  • But if you're gonna have more fun or if it's gonna be better or easier for you to do it one way, then another way, then you have to do it that way.

  • So you have to learn how to adapt a certain situations in your own way.

  • You can't always just learn from somebody else and then just regurgitate everything that they just taught you.

  • You have toe you have to figure out ways for you to use it.

  • So it stays up here and so that it translate onto the paper onto your computer in a way that you want to portray, So just a little tip that information there.

What's up, guys?

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

A2 初級

二看馬克-普萊斯iOS 10 Udemy課程--iDev Journey #7。 (Second Look at Mark Price iOS 10 Udemy Course - iDev Journey #7)

  • 0 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字