Lecture 0 - Scratch Flashcards
(39 cards)
What is the primary focus of computer programming?
Taking input and creating output to solve a problem
This process is often referred to as a black box where the internal workings are not visible.
What counting system do computers use?
Binary
Binary uses digits 0 and 1.
What is a bit?
A binary digit representing either a zero or one
A bit is the fundamental unit of data in computing.
How many distinct values can three bits represent?
Eight
Three bits can represent values from 0 to 7.
What is ASCII?
A standard that maps specific letters to specific numbers
ASCII uses binary patterns to represent characters.
What is the mapping for the letter A in ASCII?
65
01000001 in binary represents the number 65.
What does Unicode do?
Expands the number of bits to represent more characters and emojis
Unicode accommodates a wider range of characters than ASCII.
What does RGB stand for?
Red, Green, Blue
RGB is a color model used to represent colors in digital images.
What is an algorithm?
A step-by-step set of instructions to solve a problem
Algorithms can vary in efficiency and speed.
What is big-O notation?
A way to describe the efficiency of an algorithm
It expresses how the time or space requirements grow relative to input size.
What is pseudocode?
A human-readable version of code
Pseudocode helps in planning and understanding algorithms.
What are conditionals in programming?
Statements that execute actions based on whether a specific condition is met
Commonly used in if-else structures.
What is the purpose of abstraction in programming?
To simplify complex problems into smaller, manageable tasks
This helps in reducing complexity and improving code organization.
What is Scratch?
A visual programming language developed by MIT
Scratch allows users to create programs without worrying about syntax.
What is the first step to create a basic Scratch program?
Drag the ‘when green flag clicked’ block to the programming area
This starts the execution of the program.
What is the output of the program where the cat says ‘hello, world’?
The cat says ‘hello, world’ when the green flag is clicked
This illustrates the input-output relationship in programming.
What is a loop in programming?
A structure that repeats a block of code multiple times
Loops help in reducing repetition in code.
What is the role of variables in programming?
To store data values that can change during program execution
Variables hold information that can be updated or referenced.
What is an example of a simple conditional structure in Scratch?
if touching mouse-pointer? then play sound Meow
This checks a condition and executes an action based on it.
What does the ‘forever’ block do in Scratch?
It continuously executes the code inside it
This is useful for ongoing checks or actions.
What is the significance of CS50.ai?
An AI tool available for use during the course
It assists students without providing complete answers.
What are conditionals in programming?
Conditionals are an essential building block of programming, where the program checks if a specific condition has been met and performs an action if it is.
How does the forever block function in a conditional statement?
The forever block allows the if block to be triggered repeatedly, checking continuously if a condition is met.
What is the purpose of the whenclickedforeveriftouchingmouse-pointer?thenplaysoundMeowuntildone code?
This code plays a sound continuously while the cat sprite is touching the mouse pointer.