Coding with Scratch and Flowcharts
86 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

In Scratch, what is the term for the area where sprites perform actions?

  • Canvas
  • Workspace
  • Backdrop
  • Stage (correct)
  • What is the name given to a character that can be coded in Scratch?

  • Sprite (correct)
  • Actor
  • Object
  • Avatar
  • Which of the following best describes Scratch as an application?

  • Web browsing application
  • Non-textual program application (correct)
  • Text-based program application
  • Data analysis application
  • In Scratch, which element is used to store values like points that can be modified during a project?

    <p>Variable</p> Signup and view all the answers

    What type of block is used to initiate the start of a script in Scratch?

    <p>Hat Block</p> Signup and view all the answers

    Which type of block can be used above and below a block?

    <p>Stack Block</p> Signup and view all the answers

    What is the primary purpose of C-shaped blocks in Scratch?

    <p>For conditional programming</p> Signup and view all the answers

    Which type of blocks are used to represent a yes or no in Scratch?

    <p>Boolean Block</p> Signup and view all the answers

    In Scratch, which type of block is used to terminate a script?

    <p>Cap Block</p> Signup and view all the answers

    What is the main purpose of using flowcharts when writing complex programs?

    <p>To work out the flow and logic of programs</p> Signup and view all the answers

    In a flowchart, what shape typically represents a decision?

    <p>Diamond</p> Signup and view all the answers

    In Scratch, which block is used to get a user's input?

    <p>ask...and wait</p> Signup and view all the answers

    What is the purpose of the repeat X times block in Scratch?

    <p>To repeat a block of code a specific number of times.</p> Signup and view all the answers

    What is a key characteristic of a forever loop?

    <p>It executes without stopping unless the program is terminated.</p> Signup and view all the answers

    What is the main difference between a repeat until loop and a repeat X times loop?

    <p>The <code>repeat until</code> loop checks a condition, and the <code>repeat X times</code> loop does not.</p> Signup and view all the answers

    In the example of generating every fifth number, what is the variable used for?

    <p>To count with the loop.</p> Signup and view all the answers

    In creating the 'Race of 2 Sprites' game, what is the purpose of the 'Finish Line' sprite?

    <p>To determine the winner of the race.</p> Signup and view all the answers

    In the 'Race of 2 Sprites' game, how is the speed of Avery determined?

    <p>It is set randomly at the start.</p> Signup and view all the answers

    What type of loop is used to control sprite movement in the 'Race of 2 Sprites' game?

    <p>A conditional loop.</p> Signup and view all the answers

    If you wanted a sprite to move back and forth repeatedly between two points without stopping, which loop would you use?

    <p>A <code>forever</code> loop.</p> Signup and view all the answers

    Signup and view all the answers

    A 'stage' in Scratch is where characters move during a project.

    <p>True</p> Signup and view all the answers

    A 'sprite' is a block of code used to make characters move.

    <p>False</p> Signup and view all the answers

    Hat blocks can only be placed on the bottom of scripts.

    <p>False</p> Signup and view all the answers

    Stack blocks cannot be placed above other blocks in a script.

    <p>False</p> Signup and view all the answers

    C blocks are used for making the code repeat only once.

    <p>False</p> Signup and view all the answers

    Boolean blocks are used to perform complex mathematical calculations.

    <p>False</p> Signup and view all the answers

    Reporter blocks can hold both numeric and string, and can be inserted inside of other blocks when another block requires a numerical value.

    <p>True</p> Signup and view all the answers

    Cap blocks are used at the beginning of scripts.

    <p>False</p> Signup and view all the answers

    Motion blocks can only control how a sprite looks, not actual movement.

    <p>False</p> Signup and view all the answers

    Flowcharts are used to plan the logic of complex programs before coding

    <p>True</p> Signup and view all the answers

    The ask...and wait block in Scratch will display a text box where the user can input a response to a question.

    <p>True</p> Signup and view all the answers

    In Scratch, only the built-in answer variable can store a user's response and it cannot be copied to another variable.

    <p>False</p> Signup and view all the answers

    The repeat 5 block is an example of a conditional loop in Scratch.

    <p>False</p> Signup and view all the answers

    A forever loop will execute its contained code an infinite amount of times until the program is exited or the loop is otherwise stopped.

    <p>True</p> Signup and view all the answers

    In the example that creates a sequence of every fifth number (5, 10, 15...), the loop will stop when the displayed number exceeds $100$.

    <p>False</p> Signup and view all the answers

    In Scratch, a variable can be set to a random value using the random block.

    <p>True</p> Signup and view all the answers

    In the race of 2 sprites game, Avery and Rover will always move at the same speed.

    <p>False</p> Signup and view all the answers

    A flowchart for a program that computes the area of a circle would have a diamond shape to calculate the value of Pi.

    <p>False</p> Signup and view all the answers

    If you need to repeatedly move a sprite until it touches another sprite, you could use a repeat until loop for that.

    <p>True</p> Signup and view all the answers

    In the 'Race of 2 Sprites' game, the sprites stop moving once they move off the visible stage.

    <p>False</p> Signup and view all the answers

    What is the general term for a set of instructions grouped together to perform a task, commonly used in many programming languages?

    <p>Functions</p> Signup and view all the answers

    Name two categories of blocks in Scratch used to control a sprite's appearance other than its costume.

    <p>Looks and Motion</p> Signup and view all the answers

    Besides movement, what else can the 'Motion' category control?

    <p>A sprite's x and y position or direction.</p> Signup and view all the answers

    What is the primary purpose of blocks in the 'Events' category?

    <p>To sense events</p> Signup and view all the answers

    What is one block type found in the 'Control' category, which is unique to using conditionals?

    <p>C Blocks</p> Signup and view all the answers

    In Scratch, how are the 'Sensing' blocks mainly used?

    <p>To detect information</p> Signup and view all the answers

    What type of block in the 'Variables' category is used to store data?

    <p>Stack Blocks</p> Signup and view all the answers

    What does a flowchart use to represent each step of a program?

    <p>Diagrams</p> Signup and view all the answers

    If you needed a sprite to repeat a series of movements forever, what kind of loop would you use?

    <p>A <code>forever</code> loop</p> Signup and view all the answers

    In a program that uses the ask...and wait block, how can the user input be accessed?

    <p>Using the <code>answer</code> variable</p> Signup and view all the answers

    In a flowchart, what shape represents a process or action step?

    <p>A rectangle</p> Signup and view all the answers

    In Scratch, after using the ask...and wait block, where is the user's input stored?

    <p>In the <code>answer</code> variable.</p> Signup and view all the answers

    What type of loop is best used when you need to repeat a block of code a specific number of times?

    <p>A <code>repeat X times</code> loop.</p> Signup and view all the answers

    Which type of loop continues executing until a specific condition becomes true?

    <p>A <code>repeat until</code> loop</p> Signup and view all the answers

    In the example of generating every fifth number, what happens when the counter exceeds 50?

    <p>The loop stops.</p> Signup and view all the answers

    In the 'Race of 2 Sprites' game, is the starting position for Avery and Rover the same?

    <p>No, their starting positions are different.</p> Signup and view all the answers

    In the 'Race of 2 Sprites', is the AverySpeed variable initialized to a set value or a random value?

    <p>A random value.</p> Signup and view all the answers

    In the 'Race of 2 Sprites' game, what condition causes the sprites to stop moving?

    <p>When they touch the 'Finish Line' sprite.</p> Signup and view all the answers

    What type of loop could you use if you need to repeat something forever?

    <p>A <code>forever</code> loop.</p> Signup and view all the answers

    In the race of 2 sprites game, is the RoverSpeed variable set independently of AverySpeed?

    <p>Yes, they are set independently.</p> Signup and view all the answers

    The area in which sprites perform a given task is called the ______.

    <p>Stage</p> Signup and view all the answers

    A character to be coded in Scratch is called a ______.

    <p>Sprite</p> Signup and view all the answers

    ______ is a non-textual program application.

    <p>Scratch</p> Signup and view all the answers

    A ______ can store values like points that can be modified during a project.

    <p>Variable</p> Signup and view all the answers

    ______ blocks are used to start a script in Scratch.

    <p>Hat</p> Signup and view all the answers

    ______ blocks can be added above and below another block in a script.

    <p>Stack</p> Signup and view all the answers

    ______ blocks are C-shaped and are used in conditional programming.

    <p>C</p> Signup and view all the answers

    ______ blocks represent yes or no values used in logic.

    <p>Boolean</p> Signup and view all the answers

    ______ blocks are used to end scripts in Scratch.

    <p>Cap</p> Signup and view all the answers

    When writing programs, ______ help to work out the flow and logic of the programs first.

    <p>flowcharts</p> Signup and view all the answers

    In a flowchart, a rounded rectangle typically represents the ______ or end of a process.

    <p>start</p> Signup and view all the answers

    In Scratch, the 'ask...and wait' block can be used to display a box for user ______.

    <p>input</p> Signup and view all the answers

    In Scratch, a user's text entry in response to the 'ask' block is stored in the ______ variable.

    <p>answer</p> Signup and view all the answers

    A repeat X times block in Scratch will repeat its contents a ______ number of times.

    <p>specific</p> Signup and view all the answers

    A forever loop in Scratch will execute its code an ______ number of times.

    <p>infinite</p> Signup and view all the answers

    The repeat until loop will continue instructions until a specific ______ is met.

    <p>condition</p> Signup and view all the answers

    In the 'Every Fifth Number' loop example, a variable called ______ is initialized to 5.

    <p>counter</p> Signup and view all the answers

    In the 'Race of 2 Sprites' game, the 'Finish Line' sprite serves as a ______ for sprite movement.

    <p>goal</p> Signup and view all the answers

    In the 'Race of 2 Sprites' game, the variable AverySpeed is set to a ______ number between 5 and 10.

    <p>random</p> Signup and view all the answers

    The 'Race of 2 Sprites' uses a conditional loop so that the sprites keep moving until they ______ the 'Finish Line'.

    <p>touch</p> Signup and view all the answers

    Match the following block types in Scratch with their primary function:

    <p>Hat Block = Starts a script Stack Block = Performs main commands C Block = Used in conditional programming Cap Block = Ends a script</p> Signup and view all the answers

    Match the following Scratch block categories with the actions they control:

    <p>Motion = Controls movement of a sprite Looks = Changes the appearance of sprites Sound = Adds and plays sounds Events = Senses events</p> Signup and view all the answers

    Match the loop types in Scratch with their behavior:

    <p>'repeat X times' loop = Executes a block of code a specific number of times 'forever' loop = Continuously executes a block of code 'repeat until' loop = Executes a block of code until a condition is met 'if...then' block = Executes code only if a condition is true</p> Signup and view all the answers

    Match the following Scratch terms with their definitions:

    <p>Stage = The area where sprites perform tasks Sprite = A character to be coded Variable = Stores values that can be modified Function = A set of instructions grouped to perform a task</p> Signup and view all the answers

    Match the following block categories with the types of blocks they contain:

    <p>Control = Contains C blocks Sensing = Contains Boolean blocks Operators = Contains blocks for mathematical operations Variables = Contains blocks to store data</p> Signup and view all the answers

    Study Notes

    Coding with Scratch

    • Scratch is a program application for coding
    • It has different block categories for coding (e.g., Motion, Looks, Sound, Events, Control, Sensing, Operators, Variables)
    • Sprites are characters to be coded in Scratch
    • The stage is where the sprites perform a given task
    • Variables can be used to store and access data (e.g., storing points or other numerical or textual information)
    • Events are actions or situations that happen in a program (e.g., when a green flag is clicked, or when a sprite touches another sprite)
    • Control blocks control the order of events in a script (e.g., "repeat until", "forever", "if/else")
    • Sensing blocks are used to detect situations like when sprites touch each other or the mouse pointer, or check if a condition is true.

    • Operators blocks are used for mathematical operations. (e.g., pick random numbers).
    • Scratch 3.0 can be used on mobile devices

    Flowcharts and Conditional Looping

    • Flowcharts use diagrams to show steps in a program
    • Each step is shown in a rectangle
    • Decisions are shown in a diamond shape
    • Flowcharts help to plan complex programs
    • Scratch uses blocks to translate a flowchart for coding.
    • Input is received using an "ask" block, which creates a variable that can be used in conditional statements.

    • The "if...else" statement in Scratch translates to the Yes and No arrows from a flowchart
    • Looping repeats specific blocks until a certain condition is met, based on the flowchart (e.g., repeat until a variable reaches a certain value, forever loops).
    • A dry run (checking the logic step-by-step) is advised when using flowcharts

    Loops

    • Repeat X times block repeats a sequence of blocks for a set number of times
    • Forever block repeats a sequence of blocks infinitely
    • Repeat until block repeats a sequence of blocks until a specific condition is true
    • The repeat loop allows a program to repeat an action multiple times
    • Variables are often used with loops to keep track of a counter.
    • Conditional loops allow the loop to run only if a specific condition is true.

    Variables and Loops

    • Variables are used to store data and used in loops to perform actions (e.g., store user input from an "Ask" block, store values for calculation in loops)
    • Important to initialize variables before use, such as setting variables to initial values.
    • Loops and variables are very often used together.
    • Variables can be used to control the behavior of loops.
    • Variables are important for storing, updating and using data during a program.

    Game 1: Race of 2 Sprites

    • Sprites can be moved, have their appearance changed, and use random numbers for speed adjustments. (e.g., generate a random number using "pick random 5 to 10").
    • The program includes a loop to make sprites move based on speed.
    • Sprites move until they reach a defined finish line (using "touching" block)
    • Cartesian coordinates are used to describe sprite positions on the stage.
      • X and Y values are used to position sprites.
    • Sprites automatically stop when they reach the finish line.
    • Variables record sprite speed (e.g., AverySpeed).

    Game 2: To the Moon!

    • The program includes backdrop switching and sprite movement.
    • It uses specific points on the screen for sprite positions (using "go to x:y: coordinates").
    • The sprite's direction can be changed ("point in direction").
    • The sprite's costume or appearance can change during the program ("switch costume").
    • The program involves movement, turning and landing to simulate a rocket's journey to the moon. (e.g., using "glide to x, y for seconds").
    • The program includes the use of a loop to control the rocket's turning actions.
    • The program displays messages to indicate landing with "say" commands.
    • The program uses the "switch backdrop" block to change the background image.
      • The program uses the "switch costume" to change a sprite's appearance.
      • The Cartesian coordinate system to position the rocket
    • The program uses the "repeat until" loop.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Scratch Programming PDF

    Description

    This quiz explores the fundamentals of coding using Scratch, focusing on block categories, sprites, and the significance of variables and events. Additionally, it covers the use of flowcharts for planning complex programs and translating them into Scratch scripts. Test your knowledge and improve your coding skills!

    More Like This

    Use Quizgecko on...
    Browser
    Browser