Placeholder Image

字幕表 動画を再生する

  • all right.

  • Hi, everyone.

  • Welcome to see a 50 test review goal of this afternoon is going to be an opportunity to talk about all of the topics that we've really covered in CS 50 over the course of the 1st 8 weeks or so of the term and to get an opportunity to ask questions in preparation for the test.

  • So a couple of logistical notes before we get on to the actual content of what's going to be today's test review.

  • Note that the test is going to be released later this evening at 7:30 p.m. It'll be released on the course website US.

  • If you go to the core Spencer, you'll see a link to the test there.

  • You'll have until Friday, this Friday at 11 59 PM to turn in the test.

  • There's no timer on the test.

  • It's entirely self paced.

  • You're welcome to take as much or as little time within that timeframe to work in the test as you like a CZ long as you meet that final deadline of turning in the test by Friday, the eighth at 11 59 PM and you'll do so by turning in the test by a grade scope in much the same way that you've been turning in quizzes where you upload a pdf of your responses, you'll choose, which pays it pages.

  • Each of your answers to each of the questions corresponds to on that will be how you'll turn in that test.

  • A couple of rules about the honesty policy for the test.

  • The test is entirely open book, which means you're allowed to reference any of the notes.

  • You can go back and look at the lecture video of you can look at the lecture notes, the slides, any of your own notes that you've taken.

  • You're welcome to use any and all online resource is that you'd like to.

  • You're welcome to Google things.

  • Look things up for the purposes of the test.

  • The only thing you cannot do is turn to other human.

  • Resource is you cannot turn to other students in the class or other people or you're teaching fellows for questions.

  • If you need to ask anything pertaining to the test, you should email the course heads on.

  • If you email the course, heads will be able to respond to you, but that is just for, like, clarifying questions.

  • You're expected, Thio for any of the content part of the test you expected to work on that on your own without turning to other human resource is for help.

  • But you're more than welcome.

  • Thio.

  • Look things up online or reference any of the river asses on the course website, but without the lecture resources or otherwise questions about test logistics, anything about how the test is going to work.

  • Yeah, When can you expect results back after turning in the test usually will try to get the tests graded within a couple of days a week at most other questions about test logistics.

  • Yes, If you look something up on Google, should you reference that in your test response?

  • Yes.

  • At the end of every question in the test will be a debriefing section, which will ask you which resource is you used in order to answer the question.

  • So any resource is that you took advantage of whether the website you looked up online or a lecture slide just referenced that in your response to that test question, just that we have that information as well.

  • Other logistical questions about the test.

  • Oh Yes.

  • Can you resend it before the deadline?

  • Yes.

  • You're welcome to resubmit as many times as you like prior to the Friday midnight deadline.

  • Yeah.

  • Process.

  • Yeah.

  • Can you log in and out of the test across dates?

  • Absolutely.

  • There's no limit on when During that range you can access to test.

  • You can access it immediately.

  • Monday at 7 30 In fact, I'd encourage you to as soon as possible.

  • Open up the testing.

  • At least read through the questions on dhe.

  • Then you can continue to access it up until the deadline.

  • Other logistical things?

  • Yes, back there.

  • There are no tutorials or sections or office hours during the test question up there.

  • About how long should you expect the test to take you?

  • In general, we say you will probably be spending half a now, er a little more than half an hour per question.

  • And you can look back at past years testing quizzes, and usually they're in the range of like, 8 to 12 questions or so somewhere in that range.

  • All right.

  • So, a couple of ways, in terms of preparation for the test in terms of what to do first and foremost I would recommend reviewing any of the lecture resource is so that includes the lecture video, but also lecture notes, any of the source code examples the David demonstrated in lecture.

  • All of that code is made available on the course website so you can download that code or open it up in the sandbox or inside of CS 50.

  • Idea to read that code understanding.

  • Experiment with it, and you find the slides from all the videos as well.

  • From the lectures.

  • All of the past year's tests and quizzes and the solutions to those tests and quizzes are also made available online.

  • So that's another thing definitely worth looking at, because the style of the questions that are asked are generally similar in terms of the types of questions that we're asking the types of things were asking you to be thinking about.

  • So past years, test quizzes and their solutions are available online Tomb, and then I'd recommend taking a look at the problem.

  • Since the problems have specifications are online.

  • In addition to sample staff solutions that you can take a look at and those they're often helpful resources as well, just to give you a sense for the types of problems that you were asked to solve during CIA 50 so far and therefore the types of things well, you might be thinking about over the course of the test on then.

  • Of course, a great thing to do for the test preparation is what you're all doing here.

  • Attending the test review session.

  • A really big goal of this is for it to be interactive.

  • So certainly as we talked through all of the topics from Week zero all the way up until week seven, definitely feel free to flag any of us and raise your hand and ask questions because we want this preparation session to be an opportunity for you to get your questions answered about whatever topics you might have questions about.

  • Over the course of the curriculum that we've covered so far in general is goes.

  • We think about all the different weeks in the different topics we've talked about from weeks weeks.

  • There have been a number of different themes that have come up again and again, and one of the big things that we try to emphasize as we think about preparing for the test is thinking about those big themes and how it's connected.

  • Thio Ah, lot of the different topics that we've covered over the course of the course so far.

  • So the first of which is this idea of abstraction the idea that once you've been able to understand the underlying details of something, you can begin to think about it at a higher level without needing to worry about those underlying details.

  • So we saw that way back in scratch week when we introduced the idea of, like, functions and function, blocks that abstract away the details within them, or the idea that once we understand that electricity could be on or off, we can build abstractions on top of that in the number system and other systems that we use for representing information on.

  • Then we saw that in more recent weeks with things like data structures, where data structures can often be thought of abstractions of her lower level ideas or even more modern programming languages like Python that introduce a lot of new abstractions.

  • Easier ways of implementing particular tasks in comparison to a language like see where you didn't need to worry about a lot of those underlying details as you went about designing those programs.

  • Algorithms there Another big theme thinking about If you're given a problem, what are the step by step instructions you might use in order to solve that problem?

  • Remembering that in that process, you need to be very precise about telling the computer exactly what it is you want the computer to be doing.

  • You saw that this past Friday when we were doing the drawing example.

  • Where when you're trying to draw figure on the board, you have to be very precise about the instructions you're using in order to do that, representation is all about, like taking information and representing an inside the computer.

  • So we saw a lot of different ways to do this for things like, How do you represent text?

  • But also, how do you represent images?

  • How do you represent more complex data?

  • How do you store all that inside of a computer?

  • Another theme that has come across a lot during the course and then security, thinking about with any of the decisions we make.

  • Computers are vulnerable, and where are those vulnerabilities?

  • We saw a couple of those vulnerabilities when we're talking about databases this past week.

  • But we've seen other vulnerabilities when we consider things that might happen when things go wrong.

  • And so we'll be talking about a couple of those today and definitely feel free to ask about them as well.

  • And then, finally, a big theme has been trade off the idea that any time we get something in computer science, it often comes at a cost that an algorithm that might be faster might come at the cost of using more memory or an algorithm that might allow for certain operations might come at the cost of being a little bit slower.

  • And so, always thinking about with any of the decisions that we make in computer science, what the tradeoff there are.

  • What are you getting for?

  • The choice that you're making and what is the cost of the choice that you're making?

  • And thinking about those trade offs is another big theme that has come across time and time again over the course of CS 50.

  • So as we go through, all the weeks of the class will go through one week at a time.

  • Be thinking about those themes and how they connect to the topics in the course, because those will be some of the key takeaways from the class so far, questions about any of the fiends and the big ideas of the class.

  • Before we go into, we'll start with a zero.

  • All right.

  • In that case, I'll turn things over to Emma.

  • All right, so we're going to start where you all started with scratch and computational thinking in the very first or zero with week of the course.

  • And we began with trying to think and act like computers in a certain way.

  • So we learned about binary, which is a secrets of bits of zeros and ones, so a bit could be a zero or a one.

  • A sequence of eight bits would be considered a bite.

  • You can represent numbers from 0 to 2.

  • In this way, anybody know what this number is in binary?

  • Some quick maths.

  • It's really easy.

  • If you guessed the number that we would put on the board, what would it be?

  • 50 Exactly.

  • So here you can think of.

  • It's sort of like, um, a base to system.

  • So wheat counts, typically with the base 10 system.

  • You have your once place.

  • You're tense place your hundreds place, et cetera.

  • And those are the sorts of operations that we're most familiar with in regular math, but in binary math.

  • Instead, it's based to sow the first place.

  • The two to the Zeros place could be either a zero or a one, representing quite literally, a zero or a one and so forth, all the way up to two to the seventh for eight bites for eight bits to make one bite.

  • Questions about binary great.

  • So moving on from there.

  • We have different representations of numbers, letters, things that we would want to store inside of our computer, that we also want to be aware of how those air actually represented in memory itself.

  • So in Caesar, you learned a lot about asking values, numeric representation of letters.

  • We know that they're different for upper case and lower case letters, as you learned with your two lower and two upper functions, it coating and see later in the course.

  • Thes numbers are also ultimately represented in binary, so this 65 which represents a would be represented similar to the number 50 that we saw on the previous slide in by dairy.

  • When it's stored in the computer's memory and moving forward.

  • We thought about another way of representing something that you're interested in in the filter problems that you had to do with RTB triples.

  • And so rgb values or numbers from 0 to 2 55 representing the amount of red, the amount of green and the amount of blue in any given pixel, you know that you are able to manipulate those values individually.

  • You're able to manipulate them as a series.

  • And in your computer they're stored as the values for the RGB numerically, just like asking.

  • And then ultimately, again in binary questions about representations of data.

  • Yeah, yes, And so ultimately, the question is, the sum of the Artemis values is ultimately to 55.

  • And so, yes, they go all the way up to that great other questions.

  • Cool.

  • If we think about how, then we knew the letters individual and the numbers themselves, then we think about algorithms as a black box.

  • And so in the first weeks you were given access to things like get string and get integer, where you were able to take a number from a user.

  • You had some text right after it in order to get those values that you needed.

  • Ultimately those things We didn't need to know how exactly they were working as long as we were using them properly.

  • And so get straying.

  • You knew that you had to write, Get underscore string.

  • You had to import the CS 50 library, then say, you know, ask for the name of a person in quotes right afterwards.

  • And then they would type in a string to the computer, which your computer with them store in whichever variable you used there they get string documentation, and the actual code behind how it works is somewhere in the C s of the library.

  • You could find it if you wanted it, but you didn't actually need to know how it was implementing such a thing in order to use it correctly.

  • A lot of the power of computer sciences reusing things that other people have written before.

  • And so here we think about a lot of those sorts of things that you used in the first weeks of the course as black box algorithms.

  • It takes an input.

  • In this case, it took a string from the user, and it gives you your desired output variable that holds that string questions about this black box structure quote.

  • So moving forward, then in scratch, you were able to see visually what these sorts of things looked like.

  • And so we learned about all sorts of, uh, tools that we have in computer science, such as functions.

  • It takes something like this.

  • The blue ball block boxes in scratch and says, Move 10 steps.

  • 10 is the input that you give the function if you think of it, sort of like, um, your main function.

  • It takes in any sort of variable, usually returns void because it doesn't return anything directly.

  • Here.

  • This takes in an Intruder 10 and it moves that direct number of steps.

  • And so if we go to our thing about a previous life, the input is ton.

  • The output is the action of moving 10 steps.

  • Variables are something distinctly that holds a value, and so it could hold a string.

  • It can hold an integer any number of things that you define.

  • In this case it's sets my variable, which is the name of the variable to be 28.

  • That's a sort of tool that you would use money other times and see in python and beyond conditions hold Boolean statements, and so you have ifs.

  • L ifs else else's don't hold anything because they're your ultimate final thing that's going to happen in your code.

  • However, here, you know that you're if then conditions taken something called a pooling expression.

  • It says.

  • Either you know, if a equals B.

  • If A and B are both true, um, or operators, not operators.

  • You would learn about the syntax draft leave.

  • How would you?

  • You would use those things and see, and in Python later, you know that they change a little bit the double ampersand for aunt and see the actual word.

  • And in Python, however, the idea is always the same, and you know that you were able to compare any number of things of the same type in this way, loops and a similar vein represented and scratch.

  • With these yellow blocks, it can repeat something a certain number of times you learned about while loops about do while loops et cetera, and they are able to repeat actions any number of times that you define.

  • And those were all of these sorts of things that you use and became familiar with in scratch weeks.

  • Any questions about those broad concepts?

  • Cool.

  • So then we'll move into week.

  • What were you guys got the opportunity to start coding in the CIA using See your first programming language and the very first program that you likely wrote was this one you included standard io dot h and into Maine void You then wrote Print F Hello World into Maine is off.

  • Hold the void because it doesn't directly return any values.

  • The function isn't returning anything to be used anywhere later, but rather it's simply printing this message to you that you are now a computer.

  • Scientists you confront Hello world, And this was where we started.

  • One moving from here We learned about all sorts of different types of data.

  • So we know that a Boolean is something that returns true or false, true or false, are booming values.

  • A character is a single letter.

  • A double and afloat are sort of related afloat is an intruder is a number that has a decimal point in it.

  • And so it could be like 1.0 is afloat, whereas one is an integer you can represent things with more precision using close than you could.

  • Potentially using into a double is afloat that has 16 bites of memory rather than eight or eight bites memory rather than four.

  • And so that gives you even more ability to be even more precise with your calculations using a double rather than afloat.

  • Similarly, with an inter long and it's four bites along is eight, so you could hold more information along has represented, sometimes in different ways, in different coding environments.

  • But for the sake of the I.

  • D, it would be eight bites and then a string, which is in a right of characters.

  • You learned later a little bit more about what means in terms of memory directly.

  • But for the sake of Week one, we knew that strings, worries of characters, questions about data types, Yeah, for thanks, other questions cool.

  • So moving forward.

  • Once you had all of the tools to build whatever sorts of did, then you were able to use it.

  • So here we used functions like get string.

  • There was black box abstractions that are made available to you through the CS 50 library, and you would rate your variable name, string name You declare it with the crack type and then get string Name.

  • Then if I typed my name Emma in when prompted, then name would be a variable that held the string Emma or the array of characters.

  • Emma.

  • Um And then you could print using this in tax with the percent s to hold a space for a string essentially and then pass in the variable name for conditional is they would look something like this.

  • This is very familiar to you as well.

  • He would write if excellence and wine print this X is greater than why else, et cetera.

  • You know that if you have an ultimate condition, then you put it in an else without a boolean expression because anything else would fall under that, um, condition automatically by not satisfying any of the previous ones.

  • Questions about any of these things so far and see syntax.

  • You're all experts.

  • I know.

  • So then if we move forward into loops, you would write for anti equal zero I less than 50 I plus plus how many times with that print something or do the action in the middle 50 because that's how you said it.

  • So the constraints in the middle say the number of times that you want something to happen, and that's every loop you