Exam practice
Every question from the end of every unit, with hints and answers to open. After you check an answer, mark how you did, and come back to the ones you didn’t get.
13 questions
Unit 3 · Block Programming
1. Write the full forms of the given abbreviations
a. MIT b. LED c. IDE d. UNO e. BBC
Answer
- a.MIT: Massachusetts Institute of Technology
- b.LED: Light-Emitting Diode
- c.IDE: Integrated Development Environment
- d.UNO: not an abbreviation. Uno is the Italian word for “one”, the name of the Arduino board, chosen to mark version 1.0 of the Arduino software.
- e.BBC: British Broadcasting Corporation
3. Write short answers to these questions
What is Scratch?
Answer
Scratch is a free, open source block programming language, developed by the Lifelong Kindergarten Group at the MIT Media Lab. Programs are built by dragging colored blocks and snapping them together, so beginners can make games, animations, stories and quizzes without typing code. It can be used online at scratch.mit.edu or offline as an app, and projects can be shared with its worldwide community.
List the components of the Scratch interface.
Answer
The four main components: the stage (where the program’s result shows), the sprites (the objects that act on the stage), the blocks palette (all the blocks, in colored categories) and the scripts area (where blocks are joined into scripts).
The other parts: the extensions library (Add Extension), the Costumes tab (paint editor), the Sounds tab, the sprite info pane, the File menu, Choose a Sprite, Choose a Backdrop, the project name, the green flag (and stop sign) and the Backpack.
What is a micro:bit? Give any two applications of micro:bit.
Answer
A micro:bit (the BBC micro:bit) is a small, cheap, programmable computer board, about 5 cm × 4 cm, made for learning how programs and hardware work together. It has a microcontroller, 25 LEDs, two buttons, sensors (light, temperature, movement, compass) and pins for connecting other parts, and it is programmed with blocks (MakeCode) or Python.
Any two applications: education (hands-on coding and electronics); fitness (a step counter worn on a shoe); games (rock-paper-scissors, a dice); music (a banana piano); home and garden (a temperature monitor, a soil-moisture alarm); fashion (clothes with lights).
How does a micro:bit help in physical computing?
Answer
Physical computing is making systems that sense the real world and act on it, by joining hardware with software. A micro:bit has everything needed on one board: inputs (buttons, a touch logo, sensors for light, temperature, movement, direction and sound) to sense the world, a microcontroller to run the program that decides what to do, and outputs (the LEDs, the speaker, and the pins, which can switch motors, lights or a pump) to act on it. So a student can build a working device, such as a step counter or a plant-watering alarm, without having to build the electronics first.
What is ATmega328P?
Answer
The ATmega328P is the microcontroller, the “brain”, of the Arduino UNO: a small computer on one chip that runs the program uploaded to the board and controls its pins. It is an 8-bit chip made by Microchip (designed by Atmel), and on the UNO it runs at 16 MHz, with 32 KB of flash memory for the program, 2 KB of RAM and 1 KB of EEPROM.
4. Write long answers to these questions
Define block programming, and describe its features.
Answer
Block programming is a way of programming in which programs are built by dragging and dropping colored blocks, each one an instruction, and snapping them together in order like the pieces of a jigsaw puzzle, instead of typing code. It is made mainly for beginners and children. Examples: Scratch, Blockly, Snap!.
Features:
- Drag and drop: blocks are taken from a palette and joined in the scripts area; nothing is typed except values.
- No syntax errors: each block is ready-made, and its shape fits only where it makes sense.
- Colors by category: each kind of block (motion, looks, sound, control…) has its own color, so blocks are easy to find.
- Visual and immediate: the result shows at once, with graphics, animation and sound.
- Real programming ideas: sequence, loops, conditions, variables and events, the same as in every language, so learners can move on to text-based languages later.
- Event driven: scripts start when something happens, a click or a key press.
- Sharing: platforms such as Scratch let users share and remix projects.
What are the applications of block programming? Explain in brief.
Answer
- Education: schools and clubs teach programming with blocks, a strong foundation before text-based languages (Scratch, Code.org’s puzzles).
- Game development: characters, scores and game logic are built from blocks, without complex code.
- Mobile app development: tools like MIT App Inventor build Android and iPhone apps: design the screen, then join blocks for what each part does.
- Robotics: blocks program robots’ movements, behavior and sensors, on boards such as the micro:bit and Arduino UNO.
- Web development: some tools build interactive web pages from blocks, a bridge to HTML and JavaScript.
- Creative projects: animations, interactive stories, music and art.
- Modeling and simulation: a model of a real system (a disease spreading, traffic) is built with blocks, with parameters to change, to make data and predictions.
- Data science and visualization: blocks arrange and analyze data and show it as charts and graphs.
How is block programming different from traditional text-based programming?
Answer
| Block programming | Text-based programming |
|---|---|
| Programs are built by dragging and snapping blocks. | Programs are typed, character by character. |
| No syntax errors: blocks fit only where they make sense. | Syntax errors are common: one missing bracket stops the program. |
| Commands are shown on the blocks; nothing to remember. | Commands and their rules must be remembered. |
| Colorful and visual, for beginners and learning. | Plain text, used by professionals. |
| Slower to build big programs; big scripts are hard to manage. | Big programs are easier to write, organize and share. |
| Examples: Scratch, Blockly, Snap!. | Examples: Python, Java, C. |
What are blocks in block programming? Describe the block components of the Scratch programming language.
Answer
Blocks are ready-made pieces of code, each one instruction (move, say, repeat, if…), shown as colored shapes with their words on them. They are joined like puzzle pieces into scripts, which run from the top down; their shapes show how they fit (hat blocks start scripts, stack blocks are commands, C blocks wrap others, reporters hold values, booleans are true or false).
Scratch has nine categories of blocks:
- Motion (blue): move, turn, point, glide, and set or change position (x, y) and direction. move 10 steps.
- Looks (purple): change costume, color, size and visibility, and say or think things. say Hello! for 2 seconds.
- Sound (pink): play, stop and change the volume of sounds. start sound Meow.
- Events (yellow): start scripts when something happens. when green flag clicked.
- Control (orange): wait, repeat, forever, if, if-else and stop: the flow of the script. repeat 10.
- Sensing (light blue): detect touching, key presses and the mouse; ask questions. touching mouse-pointer?
- Operators (green): calculations, random numbers, comparisons and text. 10 + 10.
- Variables (dark orange): make, set, change and show variables. change score by 1.
- My Blocks (red): make custom blocks of your own. define add.
What is an Arduino UNO? Write down its types of components.
Answer
The Arduino UNO is an open source microcontroller board, the most widely used Arduino, for building electronic projects that sense and act: lights, robots, sensors, home automation. It is programmed from a computer and connects to sensors, motors and lights through its pins.
Its components are of two types:
a. Hardware: the ATmega328P microcontroller (the brain); 14 digital pins and 6 analog pins for inputs and outputs; a USB port (power and programs); a power jack (7–12 V); a reset button; a built-in LED on pin 13; a 16 MHz crystal oscillator (a clock; a resonator, also 16 MHz, times the microcontroller); and a voltage regulator (a steady 5 V).
b. Software: the Arduino IDE, where programs (sketches) are written in the Arduino language and uploaded to the board; and libraries, ready-made code for extra features.
What is a microcontroller? What is it used for?
Answer
A microcontroller is a small computer on a single chip: it holds a processor, memory, storage for its program, and pins for connecting inputs and outputs. It usually runs one program, again and again, for as long as it has power, and it is cheap and uses very little electricity.
Uses: microcontrollers control the machines around us: washing machines, rice cookers, microwave ovens, remote controls, toys, traffic lights, cars, water-level controllers and phone chargers. In learning boards they are the brain: the ATmega328P of the Arduino UNO and the processor of the micro:bit run the programs students write, reading the sensors and buttons and switching the lights, speakers and motors.
You are given a program in which the cat sprite turns 90° and says “Namaste” when the sprite is clicked. List and explain the blocks used in this program.
Answer
- when this sprite clicked (an Events block, yellow; a hat block): starts the script when the user clicks on the cat on the stage.
- turn ↻ 90 degrees (a Motion block, blue): turns the cat 90° clockwise, a quarter turn, so it faces down instead of right.
- say Namaste for 2 seconds (a Looks block, purple): shows a speech bubble with “Namaste” beside the cat for 2 seconds. (say Namaste, without seconds, would leave the bubble showing.)
The blocks run in order from the top down: event, then motion, then looks.
