Brevet (DNB) 2022 — Mathematics general stream, Centres étrangers 14 juin 2022 — exercise 4 : Algorithmics and Scratch (official exam paper)
Statement
In this exercise, all lengths are expressed in pixels.
Part A:
A teacher gives his students a pattern in the shape of a parallelogram and the partially written script that makes it possible to draw this pattern.
It is specified that the sprite is at the starting point, as shown in the figure below, and that it is facing right.
Obtained parallelogram: the starting point is the lower left vertex of the parallelogram and the sprite is facing right. The parallelogram has a horizontal side of 40 pixels, an oblique side of 30 pixels, an angle of $40^\circ$ at the lower left vertex and an angle of $140^\circ$ at the lower right vertex.
Partially written pattern script:
Define "pattern":
repeat 2 times:
- move forward 40;
- missing instruction.
Copy, in the correct order, onto your answer sheet, the following instructions to insert into the pattern script so as to draw the parallelogram above:
- move forward 30;
- turn left 40 degrees;
- turn left 140 degrees.
Part B:
The teacher then asks his students to integrate this script into a program of their choice that makes it possible to draw figures composed of several of these patterns.
Here are the programs written by two students.
Student A's program:
When right arrow is clicked;
clear all;
go to x : $-230$, y : $-170$ ;
point in direction 90 degrees;
repeat 9 times:
- pen down;
- Pattern;
- pen up;
- move forward 50.
Student B's program:
When space is clicked;
clear all;
go to x : 0, y : 0 ;
pen down;
repeat 9 times:
- Pattern;
- turn left 40 degrees;
pen up.
Recall that "point in direction 90" means that one is facing right.
1. Which keyboard action starts student B's program?
2. Among the following figures, indicate, here without justification:
a. which one is obtained with student A's program?
b. which one is obtained with student B's program?
Proposed figures:
Figure 1: nine identical parallelograms aligned horizontally from left to right, with regular spacing between the starting points; the patterns partially overlap.
Figure 2: nine identical parallelograms arranged around a regular central 9-sided polygon, each pattern turned by $40^\circ$ relative to the previous one, forming a ring.
Figure 3: nine identical parallelograms aligned horizontally from left to right, placed closer together than in Figure 1, with overlap.
Figure 4: nine identical parallelograms all having the same starting point at the center, each turned by $40^\circ$ relative to the previous one, forming a rosette.
⏳ Solution not generated yet
Open this statement in Expert Maths AI: the step-by-step solution is computed on demand, checked by a second resolution, then published here for everyone.
📝 See the solutionHave a similar exercise? Get it solved step by step, for free.
🧮 Solve my exercise